From a089a86edd720e8b2e00abfd18d4155cd70eb433 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 18 May 2014 18:58:22 +1000 Subject: [PATCH] Fix BLI_cleanup_path: '.' at the start of a path On windows "." was replaced with the root directory. On other systems any path starting with a '.' would be replaced with "/" This was added for the file selector only, so better handle this in the file selector (though it looks not to be needed). --- source/blender/blenlib/intern/path_util.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index de1ca7ef742..0ad2ba049b4 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -365,14 +365,6 @@ void BLI_cleanup_path(const char *relabase, char *path) */ #ifdef WIN32 - - /* Note, this should really be moved to the file selector, - * since this function is used in many areas */ - if (strcmp(path, ".") == 0) { /* happens for example in FILE_MAIN */ - get_default_root(path); - return; - } - while ( (start = strstr(path, "\\..\\")) ) { eind = start + strlen("\\..\\") - 1; a = start - path - 1; @@ -400,12 +392,6 @@ void BLI_cleanup_path(const char *relabase, char *path) memmove(start, eind, strlen(eind) + 1); } #else - if (path[0] == '.') { /* happens, for example in FILE_MAIN */ - path[0] = '/'; - path[1] = 0; - return; - } - while ( (start = strstr(path, "/../")) ) { a = start - path - 1; if (a > 0) {