shithub: scc

Download patch

ref: 6a5b2db971ba27989069d964a3da401d133e4b6c
parent: 69ba15ff2d2a095092354dcbf0125457b7857b89
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Dec 18 16:05:36 EST 2017

[as] Fix split()

Split() missed a else keyword and the logic was totally
fucked.

--- a/as/parser.c
+++ b/as/parser.c
@@ -54,7 +54,6 @@
 field(char **oldp, size_t *siz)
 {
 	char *s, *begin;
-	int c;
 
 	if ((begin = *oldp) == NULL)
 		return NULL;
@@ -62,7 +61,7 @@
 	if (*begin == '/') {
 		*begin = '\0';
 		*oldp = NULL;
-	} if (s = memchr(begin, '\t', *siz)) {
+	} else if (s = memchr(begin, '\t', *siz)) {
 		*s++ = '\0';
 		*siz -= s - begin;
 		*oldp = s;