Subject: Re: bin/33956: -current /bin/sh possible regression
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, njoly@pasteur.fr>
From: David Holland <dholland+netbsd@eecs.harvard.edu>
List: netbsd-bugs
Date: 07/11/2006 18:50:02
The following reply was made to PR bin/33956; it has been noted by GNATS.

From: dholland+netbsd@eecs.harvard.edu (David Holland)
To: current-users@netbsd.org, j+nbsd@2006.salmi.ch
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/33956: -current /bin/sh possible regression
Date: Tue, 11 Jul 2006 14:49:45 -0400 (EDT)

 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;