From 4d52b7ebe6d424e46cfddf2c6aa6ba704470f6ac Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 27 Jun 2007 13:56:10 +0000 Subject: 23670: rationalise some linked list functions --- Src/Zle/compcore.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'Src/Zle/compcore.c') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 3e4f690f3..348054e86 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -644,7 +644,7 @@ callcompfunc(char *s, char *fn) if (compredirs) freearray(compredirs); if (rdstrs) - compredirs = bld_list_array(rdstrs); + compredirs = zlinklist2array(rdstrs); else compredirs = (char **) zshcalloc(sizeof(char *)); @@ -1852,30 +1852,13 @@ set_comp_sep(void) return 0; } -/* This builds an array from a list of strings. */ - -/**/ -mod_export char ** -bld_list_array(LinkList l) -{ - char **a, **p; - LinkNode n; - - a = (char **) zalloc((countlinknodes(l) + 1) * sizeof(char *)); - for (p = a, n = firstnode(l); n; incnode(n)) - *p++ = ztrdup((char *) getdata(n)); - *p = NULL; - - return a; -} - /* This stores the strings from the list in an array. */ /**/ mod_export void set_list_array(char *name, LinkList l) { - setaparam(name, bld_list_array(l)); + setaparam(name, zlinklist2array(l)); } /* Get the words from a variable or a (list of words). */ -- cgit 1.4.1