Subject: Re: bin/33956: -current /bin/sh possible regression
To: David Holland <dholland+netbsd@eecs.harvard.edu>
From: Jukka Salmi <j+nbsd@2006.salmi.ch>
List: current-users
Date: 07/11/2006 10:23:11
David Holland --> current-users (2006-07-10 18:05:32 -0400):
[...]
> It turns out that there's an extra embedded null (these are used for
> dividing arguments within a quoted string) left at the end of the
> expansion of @, which causes b to be its own argument, so the extra
> space is inserted by echo.
> 
> Patch:
> 
> Index: expand.c
> ===================================================================
> RCS file: /cvsroot/src/bin/sh/expand.c,v
> retrieving revision 1.74
> diff -u -r1.74 expand.c
> --- expand.c	20 May 2006 13:57:27 -0000	1.74
> +++ expand.c	10 Jul 2006 21:57:47 -0000
> @@ -873,7 +873,8 @@
>  			for (ap = shellparam.p ; (p = *ap++) != NULL ; ) {
>  				STRTODEST(p);
>  				/* Nul forces a parameter split inside "" */
> -				STPUTC('\0', expdest);
> +				if (*ap) 
> +					STPUTC('\0', expdest);
>  			}
>  			break;
>  		}
> 

Hmm, this reverts what has been recently [1]changed to fix PR
[2]bin/33472...


Cheers, Jukka

[1] http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/expand.c.diff?r1=1.73&r2=1.74
[2] http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=33472

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~