about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2003-03-25 18:05:30 +0000
committerWayne Davison <wayned@users.sourceforge.net>2003-03-25 18:05:30 +0000
commit6eaed9fb4b09d434a412dd15d0699b84a98a3df0 (patch)
treefdcc1d4face24c515f288e8f6f4956c91f5cab1e
parent1761a3b14674350f51a074f104a4b141b6c0caa8 (diff)
downloadzsh-6eaed9fb4b09d434a412dd15d0699b84a98a3df0.tar.gz
zsh-6eaed9fb4b09d434a412dd15d0699b84a98a3df0.tar.xz
zsh-6eaed9fb4b09d434a412dd15d0699b84a98a3df0.zip
Fixed zjoin() when it returns an empty string that should be allocated.
-rw-r--r--Src/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 6671c62d9..5e9fbfb82 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1793,7 +1793,7 @@ zjoin(char **arr, int delim, int heap)
     for (s = arr; *s; s++)
 	len += strlen(*s) + 1;
     if (!len)
-	return "";
+	return heap? "" : ztrdup("");
     ptr = ret = (heap ? (char *) hcalloc(len) : (char *) zcalloc(len));
     for (s = arr; *s; s++) {
 	strucpy(&ptr, *s);