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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user