Do not allow whitespace in macro names.

Obtained from:	OpenBSD (r1.19).
This commit is contained in:
Marcelo Araujo 2016-07-11 03:34:32 +00:00
parent 823c0d5f5e
commit 391adcc526

View File

@ -144,6 +144,14 @@ include : INCLUDE STRING {
; ;
varset : STRING '=' STRING { varset : STRING '=' STRING {
char *s = $1;
while (*s++) {
if (isspace((unsigned char) *s)) {
yyerror("macro name cannot contain "
"whitespace");
YYERROR;
}
}
if (symset($1, $3, 0) == -1) if (symset($1, $3, 0) == -1)
fatal("cannot store variable"); fatal("cannot store variable");
free($1); free($1);