about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 975c5d124..2309fe27f 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -800,10 +800,12 @@ check_param(char *s, int set, int test)
 		/* Get the prefix (anything up to the character before the name). */
 		isuf = dupstring(e);
 		untokenize(isuf);
-		*e = '\0';
+		sav = *b;
+		*b = *e = '\0';
 		ripre = dyncat((ripre ? ripre : ""), s);
 		ipre = dyncat((ipre ? ipre : ""), s);
-		ripre[b - s] = '\0';
+		*b = sav;
+
 		untokenize(ipre);
 	    }
 	    else