shithub: scc

Download patch

ref: 15ef27b9b747e452e17642b36bfd996cfb5fe9ff
parent: 65e7f64721c6c48fd0e750b1d3eda32094110507
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon May 11 11:50:01 EDT 2015

Fix searching preprocessor functions

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

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -160,7 +160,9 @@
 	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 @@
 	}
 	error("incorrect preprocessor directive");
 }
-