From bc9fec6137dec23cc035c0794e79ca2d9a6d7ef5 Mon Sep 17 00:00:00 2001 From: jilles Date: Tue, 23 Jul 2013 21:09:26 +0000 Subject: wordexp(): Fix syntax validation for backslashes in single-quotes. --- lib/libc/gen/wordexp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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) -- cgit v1.1