changeset 19:a86ae56e1ed6

rogue3: make LOGFILE work with SAVEDIR
author edwarj4
date Wed, 11 Nov 2009 02:41:47 +0000
parents 95e2bbb7b6e0
children bbf072f8bafa
files rogue3/main.c rogue3/rip.c rogue3/rogue.h
diffstat 3 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/rogue3/main.c	Tue Nov 10 23:46:48 2009 +0000
+++ b/rogue3/main.c	Wed Nov 11 02:41:47 2009 +0000
@@ -38,6 +38,7 @@
     md_init(MD_STRIP_CTRL_KEYPAD);
 
     open_score();
+    open_log();
 
     /*
      * check for print-score option
--- a/rogue3/rip.c	Tue Nov 10 23:46:48 2009 +0000
+++ b/rogue3/rip.c	Wed Nov 11 02:41:47 2009 +0000
@@ -119,17 +119,10 @@
 #endif
 }
 
-#if 0 /* not necessary */
 /* Same thing, but for the log file.  Maybe combine them eventually. */
-/* FIXME you don't know what this does */
 void open_log(void)
 {
 #ifdef LOGFILE
-    if (logfi != NULL) {
-        rewind(logfi);
-        return;
-    }
-    
     logfi = fopen(LOGFILE, "a");
 
     if (logfi == NULL)
@@ -142,7 +135,6 @@
 #endif
     return;
 }
-#endif
 
 /* VARARGS2 */
 void
@@ -355,7 +347,6 @@
     else
         return;
 
-    logfi = fopen(LOGFILE, "a"); /* permissions? */
     if (logfi == NULL)
 	return;
     /* and write it */
--- a/rogue3/rogue.h	Tue Nov 10 23:46:48 2009 +0000
+++ b/rogue3/rogue.h	Wed Nov 11 02:41:47 2009 +0000
@@ -609,6 +609,7 @@
 struct linked_list *    new_thing(void);
 char *                  num(int n1, int n2);
 void                    nohaste(void);
+void                    open_log(void);
 void                    open_score(void);
 void                    option(void);
 int                     pack_char(struct object *obj);