summaryrefslogtreecommitdiff
path: root/src/misc/wordexp.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-02-11 01:37:01 -0500
committerRich Felker <dalias@aerifal.cx>2015-03-30 01:45:20 -0400
commite2063ac08b6d7a9b7049e41a399e639b738a6510 (patch)
tree399d175e8be8c04259b60af07969428e4b710049 /src/misc/wordexp.c
parentf035f7d9711cb815709802f453c78ac0c611e882 (diff)
downloadmusl-e2063ac08b6d7a9b7049e41a399e639b738a6510.tar.gz
fix bad character checking in wordexp
the character sequence '$((' was incorrectly interpreted as the opening of arithmetic even within single-quoted contexts, thereby suppressing the checks for bad characters after the closing quote. presently bad character checking is only performed when the WRDE_NOCMD is used; this patch only corrects checking in that case. (cherry picked from commit 594ffed82f4e6ee7da85e9c5da35e32946ae32c9)
Diffstat (limited to 'src/misc/wordexp.c')
-rw-r--r--src/misc/wordexp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c
index a5f1b658..db39b5b8 100644
--- a/src/misc/wordexp.c
+++ b/src/misc/wordexp.c
@@ -77,6 +77,7 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags)
if (!(sq|dq|np)) return WRDE_BADCHAR;
break;
case '$':
+ if (sq) break;
if (s[i+1]=='(' && s[i+2]=='(') {
i += 2;
np += 2;