[Bf-blender-cvs] [a089a86] master: Fix BLI_cleanup_path: '.' at the start of a path

Campbell Barton noreply at git.blender.org
Sun May 18 11:03:39 CEST 2014


Commit: a089a86edd720e8b2e00abfd18d4155cd70eb433
Author: Campbell Barton
Date:   Sun May 18 18:58:22 2014 +1000
https://developer.blender.org/rBa089a86edd720e8b2e00abfd18d4155cd70eb433

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).

===================================================================

M	source/blender/blenlib/intern/path_util.c

===================================================================

diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index de1ca7e..0ad2ba0 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) {




More information about the Bf-blender-cvs mailing list