Subject: bin/33472: /bin/sh does not expand "$@" correctly
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <rillig@NetBSD.org>
List: netbsd-bugs
Date: 05/12/2006 19:25:03
>Number:         33472
>Category:       bin
>Synopsis:       /bin/sh does not expand "$@" correctly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 12 19:25:03 +0000 2006
>Originator:     Roland Illig
>Release:        NetBSD 3.0
>Organization:
	
>Environment:
	
	
System: NetBSD baccf5ee.roland-illig.de 3.0 NetBSD 3.0 (GENERIC) #0: Mon Dec 19 01:04:02 UTC 2005 builds@works.netbsd.org:/home/builds/ab/netbsd-3-0-RELEASE/i386/200512182024Z-obj/home/builds/ab/netbsd-3-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

between NetBSD 2.0.2 and NetBSD 3.0 a bug has been introduced into
expand.c which causes the following behavior:

$ set -- "" ""
$ echo $#
2
$ echo "$@" | sed s,\$,EOL,
EOL
$

The correct behavior would be (and had been) to output one space before
the "EOL" string.

>How-To-Repeat:
	
>Fix:

Somewhere in src/bin/sh/expand.c

>Unformatted: