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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302535

View file

@ -144,6 +144,14 @@ include : INCLUDE 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)
fatal("cannot store variable");
free($1);