about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/utils.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f5e47a87..19940b460 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-12  Peter Stephenson  <pws@csr.com>
+
+	* 18524: Src/utils.c: sepjoin didn't respect !heap for an empty
+	array.  Showed up when vared'ing a zero-length array.
+
 2003-05-12  Oliver Kiddle  <opk@zsh.org>
 
 	* 18520, 13691 (Mario Lang), 13701 (Sven):
diff --git a/Src/utils.c b/Src/utils.c
index 92d97bc5c..05ef32844 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2050,7 +2050,7 @@ sepjoin(char **s, char *sep, int heap)
     char sepbuf[3];
 
     if (!*s)
-	return "";
+	return heap ? "" : ztrdup("");
     if (!sep) {
 	sep = sepbuf;
 	sepbuf[0] = *ifs;