Subject: bin/18852: /bin/sh doesn't expand "${a:-'x'}" correctly.
To: None <>
From: None <>
List: netbsd-bugs
Date: 10/29/2002 13:21:19
>Number:         18852
>Category:       bin
>Synopsis:       /bin/sh doesn't expand "${a:-'x'}" correctly.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 29 05:21:00 PST 2002
>Originator:     David Laight
>Release:        NetBSD 1.6I
System: NetBSD snowdrop 1.6I NetBSD 1.6I (GENERIC) #181: Thu Oct 24 14:06:02 BST 2002
dsl@snowdrop:/oldroot/usr/bsd-current/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
	The shell incorrectly parses ${parameter:-word} when 'word'
	contains quote characters and the entire construct is contained
	within double quotes.
	The construct "${x:-'$fred'}" might actually be useful...
	(Spotted while looking for test cases for my fixed 'jobs'
	    unset a;echo "${a:-'x'}"
	should output the single character x, but it outputs the three
	character sequence 'x'.
	Unknown - the code for parsing quotes is already complicated,
	someone who has some idea how it works might find it easier
	to fix.