From 44b19fed8207c309f2631f9299b0c325c5776762 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 1 Aug 2003 16:30:23 +0000 Subject: 18920: fix unset IFS betterer --- ChangeLog | 6 ++++++ Completion/Base/Core/_main_complete | 2 ++ Src/utils.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3e28a6b5c..6db6ad051 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-08-01 Peter Stephenson + + * 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 * 18916: Src/utils.c: Unsetting IFS could cause segmentation 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'; } -- cgit 1.4.1