From: Daniel Colascione Date: Wed, 27 Apr 2011 04:19:15 +0000 (-0700) Subject: * cmdproxy.c (try_dequote_cmdline): Notice variable substitutions in X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~203 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe9c230b7fdb2e1560449a553def0f7002a1cdd9;p=emacs.git * cmdproxy.c (try_dequote_cmdline): Notice variable substitutions in quoted strings and bail out. --- diff --git a/nt/ChangeLog b/nt/ChangeLog index 2d6f8b61e19..0d03d508557 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,8 @@ +2011-04-27 Daniel Colascione + + * cmdproxy.c (try_dequote_cmdline): Notice variable substitutions + inside quotation marks and bail out. + 2011-04-26 Daniel Colascione * cmdproxy.c (try_dequote_cmdline): New function. diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c index fe128fd17c4..8c39694decc 100644 --- a/nt/cmdproxy.c +++ b/nt/cmdproxy.c @@ -362,10 +362,20 @@ try_dequote_cmdline (char* cmdline) state = NORMAL; break; case INSIDE_QUOTE: - *new_pos++ = c; - if (c == '"') - state = NORMAL; - + switch (c) + { + case '"': + *new_pos++ = c; + state = NORMAL; + break; + case '%': + case '!': + /* Variable substitution inside quote. Bail out. */ + return 0; + default: + *new_pos++ = c; + break; + } break; } }