From 5a47554e45bf593113f872afa42962c233c62cd9 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Thu, 8 Aug 2013 14:30:12 -0700 Subject: [PATCH] rogue4: don't delete the savefile if the terminal is too small. Let the user resize the terminal and try again. --- rogue4/save.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/rogue4/save.c b/rogue4/save.c index 6bd6634..9a4324c 100644 --- a/rogue4/save.c +++ b/rogue4/save.c @@ -230,15 +230,6 @@ char **envp; 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 @@ char **envp; 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 @@ char **envp; return FALSE; } - if (rs_restore_file(inf) == FALSE) - { - endwin(); - printf("Cannot restore file\n"); - return(FALSE); - } - #ifdef SIGTSTP signal(SIGTSTP, tstp); #endif