scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 7664858c0bdfe3d55253b9a3bbb74850f6d3f9af
parent 4274f31af2f875122d6cba33338633bb81b62ed3
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 19 Jan 2024 11:54:22 +0100

make: Fix include directive

When an include directive is found is needed to update the value
of the local variable fp in nextline() because the current file
of input changed.

Diffstat:
Msrc/cmd/make/parser.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cmd/make/parser.c b/src/cmd/make/parser.c @@ -281,13 +281,14 @@ comment(FILE *fp) static char * nextline(void) { - char *s, *lim; int c; - FILE *fp = input->fp; + FILE *fp; + char *s, *lim; assert(input->type == FTFILE); repeat: + fp = input->fp; if (feof(fp)) return NULL;