diff options
author | jilles <jilles@FreeBSD.org> | 2011-04-20 22:24:54 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-04-20 22:24:54 +0000 |
commit | 1347144ea42604e45974ddf810b80ac1af548384 (patch) | |
tree | 85bc887cbbe56b0aa0f5700dc4f7350dc2764745 /bin/sh/parser.c | |
parent | bda5dc08022a9410c11ce6c121bff19ea5fc095a (diff) | |
download | FreeBSD-src-1347144ea42604e45974ddf810b80ac1af548384.zip FreeBSD-src-1347144ea42604e45974ddf810b80ac1af548384.tar.gz |
sh: Do not word split "${#parameter}".
This is only a problem if IFS contains digits, which is unusual but valid.
Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated
as ${#parameter}. The underlying problem was that "${#parameter}"
erroneously added CTLESC bytes before determining the length. This
was properly fixed for PR bin/56147 but the incorrect fix was not backed
out.
Reported by: Seeker on forums.freebsd.org
MFC after: 2 weeks
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r-- | bin/sh/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 075c04d..c4191b4 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -1572,8 +1572,8 @@ varname: pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (state[level].syntax == DQSYNTAX || - state[level].syntax == ARISYNTAX)) + if (state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; if (subtype != VSNORMAL) { |