tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bug in sh, probably, with test case

In article <>,
David Laight  <> wrote:
>On Thu, Dec 20, 2012 at 03:20:42PM -0500, Richard Hansen wrote:
>>   "a${PWD+"*"}" also expands to the string a*, but interestingly it was 
>> the string "a"*"" before the quote removal step (none of those double 
>> quotes are themselves quoted according to the quoting rules, so they are 
>> all eliminated during the quote removal step)
>I'm fairly sure netbsd's sh doesn't expand that like that.
>IIRC the inner string is expanded separately with its own quoting (starting
>with no quotes). The unwanted 'ability' to generate multiple tokens
>probably comes from the necessity of expanding "$@".
>I think expanding "a${PWD+'*'}" should give a*, not the a'*' you'd get
>from quote removal of "a'*'".
>There is probably a nice simple apparrant 'fix' that makes something
>else break 'big time'.

Can't be more broken than how it is currently. Just look at the PR's
in the test suite. I was actually going to replace all the variable
expansion code with the code in current ash, because it seems to work
better. Of course having a more exhausting test suite would give me
more confidence to do that :-)


Home | Main Index | Thread Index | Old Index