NetBSD-Bugs archive

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

Re: bin/50834 (/bin/sh incorrectly treats ${unset_or_null_var:-} as '')



The following reply was made to PR bin/50834; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/50834 (/bin/sh incorrectly treats ${unset_or_null_var:-} as '')
Date: Sat, 05 Mar 2016 03:04:34 +0700

 For the record (which should be no surprise given the implementation)
 the same is true of ${x+} if x is set.
 
 And probably related, so I am going to include it in this PR,
 the shell expands the arg to ':' in...
 
 	set --; :	$@""
 
 as nothing, rather than as a null string as it should.  It does however
 do the right thing with
 
 	set --; : ""$@
 
 (to be observable, you'd want a different test case than this one of course).
 
 kre
 


Home | Main Index | Thread Index | Old Index