mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-07-15 18:11:25 +02:00
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 -.
This commit is contained in:
parent
8d4c98540d
commit
e90a512aa6
2 changed files with 5 additions and 7 deletions
|
@ -1,5 +1,9 @@
|
||||||
2017-01-03 Peter Stephenson <p.stephenson@samsung.com>
|
2017-01-03 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* 40265: Src/pattern.c: fix continuing problems with Meta characters
|
||||||
|
in pattern that resolves to a string by copying source string.
|
||||||
|
Triggered by string that (correctly) turned Dash into '-'.
|
||||||
|
|
||||||
* Paulo Andrade: 40260: Src/prompt.c: Set newly allocated
|
* Paulo Andrade: 40260: Src/prompt.c: Set newly allocated
|
||||||
space in prompt buffer to zero as it may be tested.
|
space in prompt buffer to zero as it may be tested.
|
||||||
|
|
||||||
|
|
|
@ -668,15 +668,9 @@ patcompile(char *exp, int inflags, char **endexp)
|
||||||
if (imeta(*mtest))
|
if (imeta(*mtest))
|
||||||
nmeta++;
|
nmeta++;
|
||||||
if (nmeta) {
|
if (nmeta) {
|
||||||
char *oldpatout = patout;
|
|
||||||
ptrdiff_t pd;
|
|
||||||
patadd(NULL, 0, nmeta, 0);
|
patadd(NULL, 0, nmeta, 0);
|
||||||
/*
|
|
||||||
* Yuk.
|
|
||||||
*/
|
|
||||||
p = (Patprog)patout;
|
p = (Patprog)patout;
|
||||||
pd = patout - oldpatout;
|
opnd = dupstring_wlen(opnd, oplen);
|
||||||
opnd += pd;
|
|
||||||
dst = patout + startoff;
|
dst = patout + startoff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue