shithub: scc

Download patch

ref: 7df2442d7a009b63be92736140b7d0323eb0953c
parent: 0001a817076cbc01e7114c01a71fc1f70d6a4df5
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Dec 12 11:40:27 EST 2017

[as] Simplify the trailing character detection

We don't need a full check of the trailing line now, because we only
accept comments at the beginning of the line.

--- a/as/parser.c
+++ b/as/parser.c
@@ -112,12 +112,8 @@
 	if (lp->args = field(&s, &len))
 		r++;
 
-	if (s) {
-		while (isspace(*s))
-			++s;
-		if (*s != '\0' && *s != '/')
-			error("trailing characters at the end of the line");
-	}
+	if (s && *s && *s != '/')
+		error("trailing characters at the end of the line");
 
 	return r;
 }