summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-01-03 14:43:41 +0000
committerPeter Stephenson <pws@zsh.org>2017-01-03 14:43:41 +0000
commite90a512aa600580e25617d3a7763c5f0cd5bccd2 (patch)
treecc4644d59ff1e5390935418f49ae20aad2ff4995 /Src
parent8d4c98540de9bcdba8565facc91fbc45855d27e2 (diff)
downloadzsh-e90a512aa600580e25617d3a7763c5f0cd5bccd2.tar.gz
zsh-e90a512aa600580e25617d3a7763c5f0cd5bccd2.zip
40265: Fix problems with pure string in patterns with Meta.
Copy instead of relying on jiggery pokery with memory reallocation. Problem was triggering with string ending with Dash converted to -.
Diffstat (limited to 'Src')
-rw-r--r--Src/pattern.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index 1f2e94bd9..928790f45 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -668,15 +668,9 @@ patcompile(char *exp, int inflags, char **endexp)
if (imeta(*mtest))
nmeta++;
if (nmeta) {
- char *oldpatout = patout;
- ptrdiff_t pd;
patadd(NULL, 0, nmeta, 0);
- /*
- * Yuk.
- */
p = (Patprog)patout;
- pd = patout - oldpatout;
- opnd += pd;
+ opnd = dupstring_wlen(opnd, oplen);
dst = patout + startoff;
}