X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=dbcc9e5e842783f269c503cd3008cdab91d8827e;hb=ba12e63149a003b88b8525d6eb50d48539c660b6;hp=b2c080c33a14764eb9cfd90ef77ab0827ea258dd;hpb=f91aa93d9b3e15a37861720e1a0fbb0fbe83215a;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index b2c080c..dbcc9e5 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -2321,6 +2321,12 @@ void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp StartDir(filter, NULL); // change to start directory for this file type + if(def && *def && def[strlen(def)-1] == '/') { + getcwd(curDir, MSG_SIZ); + chdir(def); + } + + /* make a copy of the filter string, so that strtok can work with it*/ cp = strdup(filter);