New debug-mode support.
[super-star-trek.git] / src / io.c
index 48f2e3876266a13dce90226a111656ba74f280c3..7b4855f6c88048b78890a477733ae6757018bf96 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -27,6 +27,8 @@ static void outro(void)
        (void)endwin();
        putchar('\n');
     }
+    if (logfp)
+       fclose(logfp);
 }
 
 void iostart(void) 
@@ -203,6 +205,8 @@ void cgetline(char *line, int max)
     } else {
        fgets(line, max, stdin);
     }
+    if (logfp)
+       fputs(line, logfp);
     line[strlen(line)-1] = '\0';
 }