Implement -autoCopyPV
[xboard.git] / filebrowser / selfile.c
index e6edfe4..729453b 100644 (file)
@@ -883,7 +883,7 @@ XsraSelFile(toplevel, prompt, ok, cancel, failed,
                                SFprepareToReturn();
                                return stderr;
                        }
-                       if ((*name_return)[strlen(*name_return)-1] != '/' &&         // [HGM] refuse directories
+                       if ((!(*name_return)[0] || (*name_return)[strlen(*name_return)-1] != '/') &&      // [HGM] refuse directories
                            (fp = SFopenFile(*name_return, mode, prompt, failed))) {
                                SFprepareToReturn();
                                return fp;