From e90a512aa600580e25617d3a7763c5f0cd5bccd2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 3 Jan 2017 14:43:41 +0000 Subject: 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 -. --- Src/pattern.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Src/pattern.c') 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; } -- cgit 1.4.1