From 9cbb5cd6026542fba961bde455fae0729ff004b4 Mon Sep 17 00:00:00 2001 From: Bryan Stansell Date: Tue, 28 Jan 2025 12:17:01 -0800 Subject: [PATCH 1/2] fix bug with parser and "#" lines, fix debug output in ParseFile() --- conserver/cutil.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conserver/cutil.c b/conserver/cutil.c index 8120108..78d93fe 100644 --- a/conserver/cutil.c +++ b/conserver/cutil.c @@ -2415,7 +2415,7 @@ GetWord(FILE *fp, int *line, short spaceok, STRING *word) while ((c = fgetc(fp)) != EOF) { if (c == '\n') { (*line)++; - if (checkInc == -2) + if (checkInc == -2 || checkInc == 0) checkInc = -1; } if (comment) { @@ -2592,11 +2592,17 @@ ParseFile(char *filename, FILE *fp, int level) strerror(errno)); } else { char *fname; + char *sfile; + int *sline; /* word gets destroyed, so save the name */ fname = StrDup(word->string); + sfile = file; + sline = line; ParseFile(fname, lfp, level + 1); fclose(lfp); free(fname); + file = sfile; + line = sline; } } else { switch (state) { From ba8c638db168519f6816686786308ff50d71ff38 Mon Sep 17 00:00:00 2001 From: Bryan Stansell Date: Tue, 28 Jan 2025 12:23:21 -0800 Subject: [PATCH 2/2] typo --- conserver/cutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conserver/cutil.c b/conserver/cutil.c index 78d93fe..27997f6 100644 --- a/conserver/cutil.c +++ b/conserver/cutil.c @@ -2593,7 +2593,7 @@ ParseFile(char *filename, FILE *fp, int level) } else { char *fname; char *sfile; - int *sline; + int sline; /* word gets destroyed, so save the name */ fname = StrDup(word->string); sfile = file;