diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-22 08:42:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-22 08:46:03 +0400 |
commit | f6db5800410442e63b65c55c65977315bb3e9acd (patch) | |
tree | 91953a2f03c3dceec021fda32b21c340bb1e330b /source/blender/blenlib | |
parent | c9a7789bcff08dce38560a6c44ee92efb653dc2f (diff) |
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.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 7 |
1 files 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. |