summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/expand.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/expand.c b/src/expand.c
index 8c6c7f9..98ad718 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -1631,7 +1631,11 @@ _rmescapes(char *str, int flag)
 		size_t fulllen = len + strlen(p) + 1;
 
 		if (flag & RMESCAPE_GROW) {
+			int strloc = str - (char *)stackblock();
+
 			r = makestrspace(fulllen, expdest);
+			str = (char *)stackblock() + strloc;
+			p = str + len;
 		} else if (flag & RMESCAPE_HEAP) {
 			r = ckmalloc(fulllen);
 		} else {