summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-18 13:52:53 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-18 13:52:53 +0000
commit6a3e89d5391073cf51c459e7ab7b5c1e3b4528d4 (patch)
treebff862a66b49ff521b4718715be48967395ce9ef
parent8c1b953b5a6c49d47f55d311d16852f94d2ebeed (diff)
downloadzsh-6a3e89d5391073cf51c459e7ab7b5c1e3b4528d4.tar.gz
zsh-6a3e89d5391073cf51c459e7ab7b5c1e3b4528d4.tar.xz
zsh-6a3e89d5391073cf51c459e7ab7b5c1e3b4528d4.zip
fix for 15407; there may be sets without matches (15409)
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/computil.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 68e6f8631..1d0560fe4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-07-18  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 15409: Src/Zle/computil.c: fix for 15407; there may be sets
+	without matches
+
 	* 15407: Completion/Base/Utility/_describe,
 	Completion/Zsh/Command/_zstyle, Doc/Zsh/compsys.yo,
 	Src/Zle/complist.c, Src/Zle/compresult.c, Src/Zle/computil.c:
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 522c6356d..32147dd52 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -213,7 +213,7 @@ cd_init(char *nam, char *sep, char **args, int disp)
             freecdsets(cd_state.sets);
 	    return 1;
 	}
-        for (strp = &(set->strs); *ap; ap++) {
+        for (str = NULL, strp = &(set->strs); *ap; ap++) {
             *strp = str = (Cdstr) zalloc(sizeof(*str));
             strp = &(str->next);
 
@@ -231,7 +231,8 @@ cd_init(char *nam, char *sep, char **args, int disp)
             *tmp = '\0';
             str->str = str->match = ztrdup(rembslash(*ap));
         }
-        str->next = NULL;
+        if (str)
+            str->next = NULL;
 
 	if (*++args && **args != '-') {
 	    if (!(ap = get_user_var(*args))) {