summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-07-23 21:09:26 +0000
committerjilles <jilles@FreeBSD.org>2013-07-23 21:09:26 +0000
commitbc9fec6137dec23cc035c0794e79ca2d9a6d7ef5 (patch)
tree34578f391a992e930f2d23ddeacef4dfb22d1dff /lib
parent5cb590fc37a5c65062a909bd466e3e341f267f99 (diff)
downloadFreeBSD-src-bc9fec6137dec23cc035c0794e79ca2d9a6d7ef5.zip
FreeBSD-src-bc9fec6137dec23cc035c0794e79ca2d9a6d7ef5.tar.gz
wordexp(): Fix syntax validation for backslashes in single-quotes.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/wordexp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c
index 7d8b8f9..c361980 100644
--- a/lib/libc/gen/wordexp.c
+++ b/lib/libc/gen/wordexp.c
@@ -251,7 +251,8 @@ we_check(const char *words, int flags)
while ((c = *words++) != '\0') {
switch (c) {
case '\\':
- quote ^= 1;
+ if (squote == 0)
+ quote ^= 1;
continue;
case '\'':
if (quote + dquote == 0)
OpenPOWER on IntegriCloud