From f6db5800410442e63b65c55c65977315bb3e9acd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Sep 2014 14:42:07 +1000 Subject: 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. --- source/blender/blenlib/intern/path_util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index a7fa443cfc4..d5af980e373 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. -- cgit v1.2.3