mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-27 04:31:45 +00:00
Fix/work around a bug in parse_expr().
There was an obscure bug in parse_expr(), used to evaluate 'if df', where it could skip past the end of the line marker. If this happened inside an expanded macro, then after that was the next line... In other cases it might be worse. Now that this is fixed, another check for line end junk can be enabled.
This commit is contained in:
6
parse.c
6
parse.c
@@ -64,7 +64,7 @@ int check_eol(
|
||||
return 1;
|
||||
}
|
||||
|
||||
report(stack->top, "Junk at end of line ('%s')\n", cp);
|
||||
report(stack->top, "Junk at end of line ('%.20s')\n", cp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1072,7 +1072,9 @@ EX_TREE *parse_unary(
|
||||
get_symbol a second time. */
|
||||
|
||||
if (!(label = get_symbol(cp, &cp, &local))) {
|
||||
cp++; /*JH: eat first char of illegal label, else endless loop on implied .WORD */
|
||||
if (!EOL(*cp)) {
|
||||
cp++; /*JH: eat first char of illegal label, else endless loop on implied .WORD */
|
||||
}
|
||||
tp = ex_err(NULL, cp); /* Not a valid label. */
|
||||
return tp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user