From b630794be7948bee460a1bb63698752bc61a7da6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Jan 2007 15:01:56 +0000 Subject: 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 --- source/blender/python/BPY_menus.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/blender/python/BPY_menus.c') 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); -- cgit v1.2.3