From f9cb2d544a2b77e60a23f203940b36760bc64cdc Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 2 Nov 2020 07:57:13 -0500 Subject: [PATCH] More robust comment processing --- src/pebblisp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pebblisp.c b/src/pebblisp.c index d65e74c..12cccea 100644 --- a/src/pebblisp.c +++ b/src/pebblisp.c @@ -580,8 +580,16 @@ int readFile(const char *filename, struct Environment *env) { } } while(fgets(line, 256, input)) { - if(line[0] != ';') { - strncat(page, line, strlen(line) - 1); + int i; + for(i = 0; i < 256; i++) { + if(line[i] != ' ') { + if(line[i] == ';') { + break; + } else { + strncat(page, line, strlen(line) - 1); + break; + } + } } }