diff options
author | Andrea Weikert <elubie@gmx.net> | 2006-09-16 15:42:37 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2006-09-16 15:42:37 +0400 |
commit | 5277232d4264e68141c973d80b836a1482a86421 (patch) | |
tree | 05492beed292271f8bf9ea20e792f07cdf21c6c9 /source/blender/blenlib | |
parent | b150f25c36eba0091a3159fed5eab265634a3f4c (diff) |
FIX: [ #4944 ] Shift F4 menu folders are freezed
- code for adding 'c:\' on Windows missed fact that BLI_convertstringcode is also used for databrowse.
- now only replacing when path starts with '/', which isn't the case with databrowse
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 1ef9c5c8cda..28831018fa1 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -817,20 +817,27 @@ void BLI_makestringcode(const char *relfile, char *file) int BLI_convertstringcode(char *path, const char *basepath, int framenum) { - int len, wasrelative; + int len, wasrelative, is_filepath; char tmp[FILE_MAXDIR+FILE_MAXFILE]; char base[FILE_MAXDIR]; - - wasrelative= (strncmp(path, "//", 2)==0); + char vol[3] = {'\0', '\0', '\0'}; + + BLI_strncpy(vol, path, 2); + wasrelative= (strncmp(vol, "//", 2)==0); #ifdef WIN32 - if (!wasrelative && path[1] != ':') { + /* 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. + */ + if (!wasrelative && (vol[1] != ':' && (vol[0] == '\0' || vol[0] == '/' || vol[0] == '\\'))) { + char *p = path; get_default_root(tmp); // get rid of the slashes at the beginning of the path - while (*path == '\\' || *path == '/') { - path++; + while (*p == '\\' || *p == '/') { + p++; } - strcat(tmp, path); + strcat(tmp, p); } else { strcpy(tmp, path); @@ -870,7 +877,7 @@ int BLI_convertstringcode(char *path, const char *basepath, int framenum) if(len && tmp[len-1]=='#') { sprintf(tmp+len-1, "%04d", framenum); } - + strcpy(path, tmp); #ifdef WIN32 /* skip first two chars, which in case of |