summaryrefslogtreecommitdiff
path: root/bashline.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-12 22:09:11 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-12 22:09:11 -0500
commite05be32def741aff2237e1bb5ba5494ceca12654 (patch)
treeeac8a7b29b833b57355cd1ac2a48cc010cf64ba3 /bashline.c
parentbf19c529dd3f03b0dfc500900484c2d9fa221e23 (diff)
downloadbash-e05be32def741aff2237e1bb5ba5494ceca12654.tar.gz
commit bash-20101025 snapshot
Diffstat (limited to 'bashline.c')
-rw-r--r--bashline.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bashline.c b/bashline.c
index a0b0d709..7ce19361 100644
--- a/bashline.c
+++ b/bashline.c
@@ -993,6 +993,20 @@ bash_forward_shellword (count, key)
return 0;
}
+ /* Are we in a quoted string? If we are, move to the end of the quoted
+ string and continue the outer loop. We only want quoted strings, not
+ backslash-escaped characters, but char_is_quoted doesn't
+ differentiate. */
+ if (char_is_quoted (rl_line_buffer, p) && p > 0 && rl_line_buffer[p-1] != '\\')
+ {
+ do
+ ADVANCE_CHAR (rl_line_buffer, slen, p);
+ while (p < rl_end && char_is_quoted (rl_line_buffer, p));
+ count--;
+ continue;
+ }
+
+ /* Rest of code assumes we are not in a quoted string. */
/* Move forward until we hit a non-metacharacter. */
while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c))
{