diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2016-01-24 17:19:53 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2016-01-24 17:19:53 +0100 |
commit | 86ca06fb4b5a835caac37700952207db4c5073cd (patch) | |
tree | c2686e6d126d59052310c6bb7cd8df6d76fa0fca /Src/subst.c | |
parent | 370659ae9ae918a07a7950bbc2827b2593126f7d (diff) | |
parent | d18ce35d060163ea0d531170b65e1c38311af166 (diff) | |
download | zsh-86ca06fb4b5a835caac37700952207db4c5073cd.tar.gz zsh-86ca06fb4b5a835caac37700952207db4c5073cd.zip |
Merge branch 'upstream' at 5.2-dev-1 into debian
Diffstat (limited to 'Src/subst.c')
-rw-r--r-- | Src/subst.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Src/subst.c b/Src/subst.c index d9c9d24aa..bb1dd8939 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1887,12 +1887,13 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (quotetype == QT_DOLLARS || quotetype == QT_BACKSLASH_PATTERN) goto flagerr; - if (s[1] == '-') { + if (s[1] == '-' || s[1] == '+') { if (quotemod) goto flagerr; s++; quotemod = 1; - quotetype = QT_SINGLE_OPTIONAL; + quotetype = (*s == '-') ? QT_SINGLE_OPTIONAL : + QT_QUOTEDZPUTS; } else { if (quotetype == QT_SINGLE_OPTIONAL) { /* extra q's after '-' not allowed */ @@ -3583,7 +3584,10 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, ap = aval; if (quotemod > 0) { - if (quotetype > QT_BACKSLASH) { + if (quotetype == QT_QUOTEDZPUTS) { + for (; *ap; ap++) + *ap = quotedzputs(*ap, NULL); + } else if (quotetype > QT_BACKSLASH) { int sl; char *tmp; @@ -3626,7 +3630,9 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (!copied) val = dupstring(val), copied = 1; if (quotemod > 0) { - if (quotetype > QT_BACKSLASH) { + if (quotetype == QT_QUOTEDZPUTS) { + val = quotedzputs(val, NULL); + } else if (quotetype > QT_BACKSLASH) { int sl; char *tmp; tmp = quotestring(val, NULL, quotetype); |