summaryrefslogtreecommitdiffstats
path: root/bin/sh/expand.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-10-24 21:20:04 +0000
committerjilles <jilles@FreeBSD.org>2009-10-24 21:20:04 +0000
commitae4c008ec3d9b67e1adc09d619f972b0838e282b (patch)
tree630a88562311f15ec50712a00b864472ebea5f86 /bin/sh/expand.c
parent78d7070a590cfdd525d736fd6bd44f7939cb200b (diff)
downloadFreeBSD-src-ae4c008ec3d9b67e1adc09d619f972b0838e282b.zip
FreeBSD-src-ae4c008ec3d9b67e1adc09d619f972b0838e282b.tar.gz
sh: Exempt $@ and $* from set -u
This seems more useful and will likely be in the next POSIX standard. Also document more precisely in the man page what set -u does (note that $@, $* and $! are the only special parameters that can ever be unset, all the others are always set, although they may be empty).
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r--bin/sh/expand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 700fa0a..af79e8c 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -657,7 +657,7 @@ again: /* jump here after setting a variable with ${var=text} */
}
varlen = 0;
startloc = expdest - stackblock();
- if (!set && uflag) {
+ if (!set && uflag && *var != '@' && *var != '*') {
switch (subtype) {
case VSNORMAL:
case VSTRIMLEFT:
OpenPOWER on IntegriCloud