Allow comments in logfiles.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 24 May 2017 14:07:05 +0000 (10:07 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 24 May 2017 14:07:05 +0000 (10:07 -0400)
misc.c

diff --git a/misc.c b/misc.c
index f1bd954c7932cdf9c463c072c2f1a970b166e340..77d81bcbc48b87fa388ea2006de57935eb074230 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -884,8 +884,12 @@ void fMAPLIN(FILE *OPENED) {
        if(MAP2[1] == 0)MPINIT();
 
        if (!oldstyle && SETUP)
-           fputs("> ", stdout);
-       IGNORE(fgets(raw_input,sizeof(INLINE)-1,OPENED));
+               fputs("> ", stdout);
+       do {
+               IGNORE(fgets(raw_input,sizeof(INLINE)-1,OPENED));
+       } while
+               /* allow comments in logfiles */
+               (!feof(OPENED) && raw_input[0] == '#');
        if (feof(OPENED)) {
                if (logfp)
                        fclose(logfp);