From 73f1d88be2197a945228a895b738b3ded0cda364 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 9 Aug 2010 22:54:40 +0000 Subject: 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. --- source/blender/blenlib/intern/path_util.c | 2 ++ source/blender/editors/space_file/filesel.c | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'source') diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 9a56722b5d9..260f59aa03c 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -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); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 659763921c7..8783296f5c2 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -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; } -- cgit v1.2.3