summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-09-17 09:25:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-09-17 09:25:38 +0000
commit037485c4a474395064e2b5b1da281ca052796320 (patch)
tree7033c03726ddf0a3891b99b741e56a04ab93e388 /Src/utils.c
parent53383c33b80061c8d651dde7e554d68395b48899 (diff)
downloadzsh-037485c4a474395064e2b5b1da281ca052796320.tar.gz
zsh-037485c4a474395064e2b5b1da281ca052796320.tar.xz
zsh-037485c4a474395064e2b5b1da281ca052796320.zip
20378: Matthias B.: fix bugs joining with metafied chars.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 143855160..ba31a1315 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1912,16 +1912,14 @@ zjoin(char **arr, int delim, int heap)
     ptr = ret = (heap ? (char *) hcalloc(len) : (char *) zshcalloc(len));
     for (s = arr; *s; s++) {
 	strucpy(&ptr, *s);
-	if (delim) {
 	    if (imeta(delim)) {
 		*ptr++ = Meta;
 		*ptr++ = delim ^ 32;
 	    }
 	    else
 		*ptr++ = delim;
-	}
     }
-    ptr[-1] = '\0';
+    ptr[-1 - (imeta(delim) ? 1 : 0)] = '\0';
     return ret;
 }