diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-01-17 18:01:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-01-17 18:01:56 +0300 |
commit | b630794be7948bee460a1bb63698752bc61a7da6 (patch) | |
tree | 35e4523e6e07d96e8b17f97600742a0548ce2d41 /source/blender/python | |
parent | 9bc90c1669176e7b86964ae078b0b2993835d3dc (diff) |
bugfix for 5572, BLI_makestringcode was being used to join 2 paths, but adding c:\ to the start of a non root dir. it wold be nice to have a BLI_join_path for this to avoid #ifdef WIN32's in the main code and to check for existing shashes
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/BPY_menus.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c index 96b54439a0e..6ad963fe12a 100644 --- a/source/blender/python/BPY_menus.c +++ b/source/blender/python/BPY_menus.c @@ -826,7 +826,7 @@ static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir ) char path[FILE_MAXDIR]; char subdir[FILE_MAXDIR]; char *s = NULL; - + dir = opendir(dirname); if (dir != NULL) { @@ -838,7 +838,7 @@ static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir ) } BLI_make_file_string("/", path, dirname, de->d_name); - + if (stat(path, &status) != 0) { if (DEBUG) fprintf(stderr, "stat %s failed: %s\n", path, strerror(errno)); @@ -854,7 +854,15 @@ static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir ) if (file) { s = de->d_name; if (parentdir) { - BLI_make_file_string(NULL, subdir, parentdir, de->d_name); + /* Join parentdir and de->d_name */ + short a = strlen(parentdir); + strcpy(subdir, parentdir); + strcpy(subdir + a+1, de->d_name); +#ifdef WIN32 + subdir[a] = '\\'; +#else + subdir[a] = '/'; +#endif s = subdir; } bpymenu_ParseFile(file, s, is_userdir); |