When we are not browsing merely to obtain a name to put in a text edit,
but really must return an open file pointer, selection of a directory
(ending in '/') can no longer be OK'ed in the file browser. (XBoard
tends to segfault when offered garbage for game or position file...)
SFprepareToReturn();
return stderr;
}
- if (fp = SFopenFile(*name_return, mode,
- prompt, failed)) {
+ if ((*name_return)[strlen(*name_return)-1] != '/' && // [HGM] refuse directories
+ (fp = SFopenFile(*name_return, mode, prompt, failed))) {
SFprepareToReturn();
return fp;
}