diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-07-25 21:36:54 +0100 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-07-25 21:36:54 +0100 |
commit | dd8079e0415cf213d9bb5d41d1ad95c04b774f3a (patch) | |
tree | 8b5e346d5b1121b49caf5724ca936ab9e5fe4d9e | |
parent | 771381c2ce0587d825528d49244006edf770fd47 (diff) | |
download | zsh-dd8079e0415cf213d9bb5d41d1ad95c04b774f3a.tar.gz zsh-dd8079e0415cf213d9bb5d41d1ad95c04b774f3a.tar.xz zsh-dd8079e0415cf213d9bb5d41d1ad95c04b774f3a.zip |
35809: fix $((...)) completion by _expand widget.
This changes internal quoting of the form still including tokens not to add unnecessary internal backslashes.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/utils.c | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index b74208d2d..899ff08e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-07-25 Peter Stephenson <p.w.stephenson@ntlworld.com> + * 35909: Src/utils.c: fix $((...) completion in _expand by + normalising quoting of the math expression containing tokens. + * 35908: Src/ZLe/zle_tricky.c: fix $((...)) completion by expand-or-complete widget. diff --git a/Src/utils.c b/Src/utils.c index 0acab88ff..f7aaaedf4 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -5551,7 +5551,25 @@ quotestring(const char *s, char **e, int instring) /* Needs to be passed straight through. */ if (dobackslash) *v++ = '\\'; - *v++ = *u++; + if (*u == Inparmath) { + /* + * Already syntactically quoted: don't + * add more. + */ + int inmath = 1; + *v++ = *u++; + for (;;) { + char uc = *u; + *v++ = *u++; + if (uc == '\0') + break; + else if (uc == Outparmath && !--inmath) + break; + else if (uc == Inparmath) + ++inmath; + } + } else + *v++ = *u++; continue; } |