about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-08-01 16:30:23 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-08-01 16:30:23 +0000
commit44b19fed8207c309f2631f9299b0c325c5776762 (patch)
treeb1c020032067e0fc9feeb8c0fc752ae5377e5b4b
parent854a4dc348025dc8044f1132e63561e4249a2f87 (diff)
downloadzsh-44b19fed8207c309f2631f9299b0c325c5776762.tar.gz
zsh-44b19fed8207c309f2631f9299b0c325c5776762.tar.xz
zsh-44b19fed8207c309f2631f9299b0c325c5776762.zip
18920: fix unset IFS betterer
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Base/Core/_main_complete2
-rw-r--r--Src/utils.c2
3 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e28a6b5c..6db6ad051 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2003-08-01  Peter Stephenson  <pws@csr.com>
 
+	* 18920: Src/utils.c, Completion/Core/Base/_main_complete: update
+	18916 to use space to join if unset, as per POSIX; set IFS locally
+	in completion just in case.
+
+2003-08-01  Peter Stephenson  <pws@csr.com>
+
 	* 18916: Src/utils.c: Unsetting IFS could cause segmentation
 	fault (any time IFS was used to join an array).
 
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index 5960b2da7..cb6905d8e 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -3,6 +3,8 @@
 # The main loop of the completion code. This is what is called when 
 # completion is attempted from the command line.
 
+# In case non-standard separators are in use.
+local IFS=$' \t\n\0'
 
 # If you want to complete only set or unset options for the unsetopt
 # and setopt builtin, un-comment these lines:
diff --git a/Src/utils.c b/Src/utils.c
index 4a6c1d3f6..e2a6ab60f 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2033,6 +2033,8 @@ sepjoin(char **s, char *sep, int heap)
 	if (ifs) {
 	    *p++ = *ifs;
 	    *p++ = *ifs == Meta ? ifs[1] ^ 32 : '\0';
+	} else {
+	    *p++ = ' ';
 	}
 	*p = '\0';
     }