diff arogue7/main.c @ 145:aac28331e71d

Advanced Rogue family: fix the "score" option. Changing the score file (when permitted) now works again, closing the old score file and opening the new one.
author John "Elwin" Edwards
date Wed, 20 May 2015 08:42:17 -0400
parents 7faf4568c295
children 301ed6992c2e
line wrap: on
line diff
--- a/arogue7/main.c	Mon May 18 10:53:22 2015 -0400
+++ b/arogue7/main.c	Wed May 20 08:42:17 2015 -0400
@@ -16,8 +16,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
-#include <sys/types.h>
-#include <fcntl.h>
 #ifdef BSD
 #include <sys/time.h>
 #else
@@ -33,8 +31,6 @@
 extern char oldtext[WTXTNUM][WTXTLEN];
 #endif
 
-int scorefd = -1;
-FILE *logfile = NULL;
 void open_records(void);
 
 main(argc, argv, envp)
@@ -553,7 +549,7 @@
 open_records(void)
 {
     if (scorefd == -1)
-        scorefd = open(score_file, O_RDWR | O_CREAT, 0666);
+        md_reopen_score();
 #ifdef LOGFILE
     if (logfile == NULL)
         logfile = fopen(LOGFILE, "a");