[Bf-blender-cvs] [f6db580] master: Fix T41891: Alt+S can't save image

Campbell Barton noreply at git.blender.org
Mon Sep 22 06:50:15 CEST 2014


Commit: f6db5800410442e63b65c55c65977315bb3e9acd
Author: Campbell Barton
Date:   Mon Sep 22 14:42:07 2014 +1000
Branches: master
https://developer.blender.org/rBf6db5800410442e63b65c55c65977315bb3e9acd

Fix T41891: Alt+S can't save image

win32 BLI_path_abs expanded empty strings into "C:\\",
which made BLI_exists succeed (quite confusing).

Now match behavior on *nix.

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

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 a7fa443..d5af980 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -873,9 +873,12 @@ bool BLI_path_abs(char *path, const char *basepath)
 	char tmp[FILE_MAX];
 	char base[FILE_MAX];
 #ifdef WIN32
-	char vol[3] = {'\0', '\0', '\0'};
 
-	BLI_strncpy(vol, path, 3);
+	/* without this: "" --> "C:\" */
+	if (*path == '\0') {
+		return wasrelative;
+	}
+
 	/* we are checking here if we have an absolute path that is not in the current
 	 * blend file as a lib main - we are basically checking for the case that a 
 	 * UNIX root '/' is passed.




More information about the Bf-blender-cvs mailing list