diff options
author | jilles <jilles@FreeBSD.org> | 2015-11-18 21:09:03 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2015-11-18 21:09:03 +0000 |
commit | cf0d26dcd6f3ae0595b32f615c52e365a58478c0 (patch) | |
tree | 7ccc5ddee96c6a52ecb1e104b67ce2610af523e4 /bin/sh/expand.c | |
parent | b5240dc1944697c0e8cfcbde23981eab5936e502 (diff) | |
download | FreeBSD-src-cf0d26dcd6f3ae0595b32f615c52e365a58478c0.zip FreeBSD-src-cf0d26dcd6f3ae0595b32f615c52e365a58478c0.tar.gz |
sh: Fix ""$@, which should not use the special case for "$@".
"$@" should expand to no words if there are no positional parameters, but
""$@ should always expand to at least an empty word.
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r-- | bin/sh/expand.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c index f7c6735..6217982 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -249,7 +249,8 @@ argstr(char *p, int flag) case CTLQUOTEMARK: lit_quoted = 1; /* "$@" syntax adherence hack */ - if (p[0] == CTLVAR && p[2] == '@' && p[3] == '=') + if (p[0] == CTLVAR && (p[1] & VSQUOTE) != 0 && + p[2] == '@' && p[3] == '=') break; if ((flag & EXP_FULL) != 0) USTPUTC(c, expdest); |