scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 50bfc145d470d78dfe38594a3a94123375c3a66a
parent b65a8b5e2010123b7af1ae1e2e67ea1b0dc6c35f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 28 Oct 2013 21:32:42 +0100

Fix ahead

ahead calls to skip to avoid problems with spaces, but it didn't
check the value returned by skip, so in the end of the file it was
not returning EOFTOK, like is desired.

Diffstat:
Mlex.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lex.c b/lex.c @@ -328,7 +328,8 @@ ahead(void) { register char c; - skip(); + if (!skip()) + return EOFTOK; ungetc(c = getc(yyin), yyin); return c; }