Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Re: long/short options



Andrej Borsenkow wrote:

> bor@itsrm2% zsh
> bor@itsrm2% gdiff -bTAB
> zsh: bus error (core dumped)  zsh

Ouch.  Sets without matches are possible.

Sorry.  Thanks.


Bye
  Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.63
diff -u -r1.63 computil.c
--- Src/Zle/computil.c	2001/07/18 13:10:10	1.63
+++ Src/Zle/computil.c	2001/07/18 13:50:04
@@ -213,7 +213,7 @@
             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 @@
             *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))) {

-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author