about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/pattern.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index 4e2f2369f..158bfd560 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -669,12 +669,16 @@ patcompile(char *exp, int inflags, char **endexp)
 				nmeta++;
 			if (nmeta) {
 			    char *oldpatout = patout;
+			    ptrdiff_t pd;
 			    patadd(NULL, 0, nmeta, 0);
 			    /*
 			     * Yuk.
 			     */
 			    p = (Patprog)patout;
-			    opnd = patout + (opnd - oldpatout);
+			    pd = patout - oldpatout;
+			    opnd += pd;
+			    pscan += pd;
+			    next += pd;
 			    dst = patout + startoff;
 			}