[email protected] wrote:
> Instead of having to use another 1KB buffer just to figure out where
> the '=' sign is, use the parser infrastructure already present. Also
> allows for variable timeout option. Another (negligible) advantage: if
> one day someone wants to change the maximum line length, they only need
> to do so in one spot.
>
> I haven't touched the code in env.c that handles the '-' and '$' since
> these are extremely simple anyway, and aren't needed for the next patch.
>
> This patch doesn't need changes to doas(1) or doas.conf(5) man pages, but
> there
> is no mention of characters that are required to be escaped when specifying
> args.
> Tested with all kinds of variable names and values, works fine:
>
> ... keepenv { FIRE SWITCH=1 NO_PLACE_LIKE=$HOME WATER}
>
> Things I would like feedback on, in particular:
>
> 1. Loops - Use C99 style initialisation?
> for(int i = 0; i < monsters; i < 666)
No.
> 3. Anything of major concern.
Adding a new character to the lexer potentially breaks existing config files.
Also, I'm not sure how you tested this, because it doesn't work like you say
it does. setenv { HERE=there } copies both $HERE and $there from the current
environment. It does not set HERE=there. That's very wrong.