On Tue, Jun 21, 2016 at 10:14:52AM +0200, Sebastian Benoit wrote:
>
> same thing without a stupid helper function, pointed out by henning.
>
> diff --git sbin/pfctl/parse.y sbin/pfctl/parse.y
> index 934438c..426cd93 100644
> --- sbin/pfctl/parse.y
> +++ sbin/pfctl/parse.y
> @@ -714,6 +714,10 @@ numberstring : NUMBER
> {
> varset : STRING '=' varstring {
> if (pf->opts & PF_OPT_VERBOSE)
> printf("%s = \"%s\"\n", $1, $3);
> + if (strchr($1, ' ') != NULL) {
The previous version used isspace(3). Now, what about tabs? Do we not care?
> + yyerror("macro name cannot contain whitespace");
> + YYERROR;
> + }
> if (symset($1, $3, 0) == -1)
> err(1, "cannot store variable %s", $1);
> free($1);