From bbec0d05141462b07a1e65df88e8cc1b62d129a4 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Wed, 11 Nov 2009 02:41:47 +0000 Subject: [PATCH] rogue3: make LOGFILE work with SAVEDIR --- rogue3/main.c | 1 + rogue3/rip.c | 9 --------- rogue3/rogue.h | 1 + 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/rogue3/main.c b/rogue3/main.c index 467bce3..5954a83 100644 --- a/rogue3/main.c +++ b/rogue3/main.c @@ -38,6 +38,7 @@ char **envp; md_init(MD_STRIP_CTRL_KEYPAD); open_score(); + open_log(); /* * check for print-score option diff --git a/rogue3/rip.c b/rogue3/rip.c index b6c0a89..98800e8 100644 --- a/rogue3/rip.c +++ b/rogue3/rip.c @@ -119,17 +119,10 @@ open_score(void) #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 @@ void open_log(void) #endif return; } -#endif /* VARARGS2 */ void @@ -355,7 +347,6 @@ void writelog(int amount, int flags, int monst) else return; - logfi = fopen(LOGFILE, "a"); /* permissions? */ if (logfi == NULL) return; /* and write it */ diff --git a/rogue3/rogue.h b/rogue3/rogue.h index fb15145..375cc8c 100644 --- a/rogue3/rogue.h +++ b/rogue3/rogue.h @@ -609,6 +609,7 @@ void new_monster(struct linked_list *item, int type, coord *c 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);