changeset 84:a0d4caead33b

rogue4: don't delete the savefile if the terminal is too small. Let the user resize the terminal and try again.
author John "Elwin" Edwards
date Thu, 08 Aug 2013 14:30:12 -0700
parents 09db0cf536af
children d852b8f088c5
files rogue4/save.c
diffstat 1 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/rogue4/save.c	Thu Aug 08 12:41:35 2013 -0700
+++ b/rogue4/save.c	Thu Aug 08 14:30:12 2013 -0700
@@ -230,15 +230,6 @@
     fstat(inf, &sbuf2);
     fflush(stdout);
     syml = issymlink(file);
-    if (
-#ifdef WIZARD
-	!wizard &&
-#endif
-    md_unlink(file) < 0)
-    {
-	printf("Cannot unlink file\n");
-	return FALSE;
-    }
 
     fflush(stdout);
 
@@ -272,6 +263,23 @@
     mpos = 0;
     mvprintw(0, 0, "%s: %s", file, ctime(&sbuf2.st_mtime));
 
+    if (rs_restore_file(inf) == FALSE)
+    {
+	endwin();
+        printf("Cannot restore file\n");
+        return(FALSE);
+    }
+
+    if (
+#ifdef WIZARD
+	!wizard &&
+#endif
+    md_unlink(file) < 0)
+    {
+	printf("Cannot unlink file\n");
+	return FALSE;
+    }
+
     /*
      * defeat multiple restarting from the same place
      */
@@ -284,13 +292,6 @@
 	    return FALSE;
 	}
 
-    if (rs_restore_file(inf) == FALSE)
-    {
-	endwin();
-        printf("Cannot restore file\n");
-        return(FALSE);
-    }
-
 #ifdef SIGTSTP
     signal(SIGTSTP, tstp);
 #endif