NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/47361: /bin/sh incorrectly applies IFS to $barwhen expanding "${foo-$bar}"

>Number:         47361
>Category:       bin
>Synopsis:       /bin/sh incorrectly applies IFS to $barwhen expanding 
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 22 19:55:00 +0000 2012
>Originator:     David Laight
>Release:        All
Any /bin/sh with expand.h 1.87 or earlier (or equivalent for release branches)
/bin/sh incorrectly applies filed splitting when expanding the alternate
text for ${foo-$bar} and ${foo+$bar}.

For Greg Troxel on tech-userlevel.
sh -c 'a="x  x"; printf "%s\n" "${PWD+$a}"'
should output "x  x" (without the quotes) on a single line,
buggy versions output one x one each of two lines.

Home | Main Index | Thread Index | Old Index