More robust comment processing

This commit is contained in:
Sage Vaillancourt 2020-11-02 07:57:13 -05:00
parent 54e2e09c5c
commit f9cb2d544a
1 changed files with 10 additions and 2 deletions

View File

@ -580,8 +580,16 @@ int readFile(const char *filename, struct Environment *env) {
} }
} }
while(fgets(line, 256, input)) { while(fgets(line, 256, input)) {
if(line[0] != ';') { int i;
strncat(page, line, strlen(line) - 1); for(i = 0; i < 256; i++) {
if(line[i] != ' ') {
if(line[i] == ';') {
break;
} else {
strncat(page, line, strlen(line) - 1);
break;
}
}
} }
} }