On Wed, 15 Mar 2017 13:22:53 -0400 "Ted Unangst" <t...@tedunangst.com> wrote: ... > > 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.
I was considering that, considering that maybe someone will want "foo=bar" parameters in their command lines. Which is why I am thinking it is best to strike here while the iron is hot rather than, say, 5 years later, when people have come up with complex and tuned-over-the-years configurations. Not something difficult to fix either, just enclose in quotes or escape, as necessary with curly braces. There is a way around this (such as not moving to "eow" on special characters, when the lexer is in a 'command-line argument-parsing mode') but that may require code added to the lexer. How much extra code is needed, I don't know. This function of parsing is the lexer's domain, and seems neater than having what is essentially two separate lexers; all I am doing here is merging the "mini-lexer" into the main lexer. > > 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. > How are you getting that result? Here is what I am getting: $ export HERE=hello $ export there=world $ echo $HERE $there hello world $ doas ~/test.sh HERE is there there is The shell script: #!/bin/sh echo "HERE" is $HERE echo "there" is $there And /etc/doas.conf: permit persist setenv { HERE=there } :wheel permit nopass keepenv root This test behaves correctly on my end.