Bugfix for:[23234] Blender File Browser - Back Button does work with first directory entered?
For !WIN32 systems the fix was in ED_fileselect_set_params (basically adding the first folder in the sfile->folders_prev list) For WIN32: I talked with Nathan (Jesterking) and he agreed that the fix in path_util.c was required too. Without that BLI_path_abs was always making WIN32 paths ending with \ to end with \\ (e.g. C:\Blender\ --> C:\Blender\\) And this was making the folder to fail ISDIR tests.
This commit is contained in:
@@ -637,6 +637,8 @@ int BLI_path_abs(char *path, const char *basepath)
|
||||
|
||||
if (path[0]!='\0') {
|
||||
if ( path[strlen(path)-1]=='/') {
|
||||
/* remove the '/' so we avoid BLI_cleanup_dir adding an extra \ in WIN32 */
|
||||
path[strlen(path)-1] = '\0';
|
||||
BLI_cleanup_dir(NULL, path);
|
||||
} else {
|
||||
BLI_cleanup_file(NULL, path);
|
||||
|
||||
@@ -206,6 +206,13 @@ short ED_fileselect_set_params(SpaceFile *sfile)
|
||||
params->filter = 0;
|
||||
params->sort = FILE_SORT_ALPHA;
|
||||
}
|
||||
|
||||
|
||||
/* initialize the list with previous folders */
|
||||
if (!sfile->folders_prev)
|
||||
sfile->folders_prev = folderlist_new();
|
||||
folderlist_pushdir(sfile->folders_prev, sfile->params->dir);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user