scc

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

commit 8d86e755638ff37a59db1dc95413818106d50c86
parent 86648da0334bde1671813c6906d74ce8508ead5d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 26 Sep 2017 10:57:33 +0100

[as] Get rid of : in labels definition

Diffstat:
Mas/parser.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/as/parser.c b/as/parser.c @@ -88,9 +88,14 @@ static int extract(char *s, struct line *lp) { int r = 0; + size_t len; - if (lp->label = field(&s)) + if (lp->label = field(&s)) { + len = strlen(lp->label); + if (lp->label[len-1] == ':') + lp->label[len-1] = '\0'; r++; + } if (lp->op = field(&s)) r++; if (lp->args = field(&s))