Subject: Re: bin/33956: -current /bin/sh possible regression
To: None <current-users@netbsd.org, j+nbsd@2006.salmi.ch>
From: David Holland <dholland+netbsd@eecs.harvard.edu>
List: current-users
Date: 07/11/2006 14:49:45
I just wrote:
> - if (*start) {
> + if (*start || inquotes) {
That's not quite right; it inserts a spurious blank argument when you do
'set -- ; echo "$@"'. Which should probably get added to the regression
test too.
Use this instead:
--- expand.c.save 2006-07-10 17:56:18.000000000 -0400
+++ expand.c 2006-07-11 14:41:24.000000000 -0400
@@ -1035,7 +1035,7 @@
* Some recent clarification of the Posix spec say that it
* should only generate one....
*/
- if (*start) {
+ if (*start || (inquotes && start > string)) {
sp = (struct strlist *)stalloc(sizeof *sp);
sp->text = start;
*arglist->lastp = sp;