]> granicus.if.org Git - nethack/commitdiff
M164: finding saved games in QT nethack start
authorcohrs <cohrs>
Sun, 5 Feb 2006 00:58:13 +0000 (00:58 +0000)
committercohrs <cohrs>
Sun, 5 Feb 2006 00:58:13 +0000 (00:58 +0000)
Only 5 months old.  The Unix code to find saved games, currently only enabled
for Qt use, fails to use fqname and SAVEPREFIX, so it doesn't find saved
games when prefixes are in effect.

doc/fixes34.4
src/files.c

index df1414a9cde2349eca09d766cae831794f7dd3ae..3d67b11fa9b32bdec66e337847f019da974bacf0 100644 (file)
@@ -204,6 +204,7 @@ winCE: disable processing of double-click messages if the first click
 X11: ensure vertical scrollbar shows up in text display windows
 X11: fix typo in mouse click sanity check; result might have pointed to
        spurious location after window resizing
+unix/Qt: saved games were not found if nethack was built with prefixes in use
 
 
 General New Features
index 09d0d5f3c87a882ba418b141abe30f397c28181f..98371420f869bd8c2d507770f9c829885ee536d0 100644 (file)
@@ -1083,13 +1083,13 @@ get_saved_games()
        /* posixly correct version */
     int myuid=getuid();
     DIR *dir;
-    if((dir=opendir("save"))) {
+    if((dir=opendir(fqname("save", SAVEPREFIX, 0)))) {
        for(n=0; readdir(dir); n++)
                ;
        closedir(dir);
        if(n>0) {
                int i;
-               if(!(dir=opendir("save")))
+               if(!(dir=opendir(fqname("save", SAVEPREFIX, 0))))
                        return 0;
                result = (char**)alloc((n+1)*sizeof(char*)); /* at most */
                for (i=0, j=0; i<n; i++) {
@@ -1116,7 +1116,7 @@ get_saved_games()
                return result;
        }
     }
-#endif
+#endif /* SELECTSAVED */
     return 0;
 }