scc

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

commit 15ef27b9b747e452e17642b36bfd996cfb5fe9ff
parent 65e7f64721c6c48fd0e750b1d3eda32094110507
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 11 May 2015 15:50:01 +0200

Fix searching preprocessor functions

In one of the last commits there was an error and
preprocessor lookup function was broken, until now ;)

Diffstat:
Mcc1/cpp.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -160,7 +160,9 @@ preprocessor(char *p) n = q - p; while (isspace(*q)) ++q; - for (bp = cmds; bp->name && strncmp(bp->name, p, n); ++bp) { + for (bp = cmds; bp->name; ++bp) { + if (strncmp(bp->name, p, n)) + continue; q = (*bp->fun)(q); while (isspace(*q++)) /* nothing */; @@ -170,4 +172,3 @@ preprocessor(char *p) } error("incorrect preprocessor directive"); } -