Fall back to get_persdatafile_dir() if recent.gui_fileopen_remembered_dir

does not exist or is no directory.

svn path=/trunk/; revision=33323
This commit is contained in:
Stig Bjørlykke 2010-06-25 19:22:32 +00:00
parent 7608a89820
commit 86d55f9a13
1 changed files with 6 additions and 1 deletions

View File

@ -2252,7 +2252,12 @@ main(int argc, char *argv[])
"Could not open recent file\n\"%s\": %s.",
rf_path, strerror(rf_open_errno));
}
set_last_open_dir(recent.gui_fileopen_remembered_dir);
if (test_for_directory(recent.gui_fileopen_remembered_dir) != EISDIR) {
set_last_open_dir(get_persdatafile_dir());
} else {
set_last_open_dir(recent.gui_fileopen_remembered_dir);
}
/* Set getopt index back to initial value, so it will start with the
first command line parameter again. Also reset opterr to 1, so that