From 10490ec499fff7b932f92a0b19c7e5343a24761d Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Fri, 1 Mar 2002 10:41:59 +0000 Subject: add $redirections array to completion system parameters, containing information about all redirections on the line; make this and compstate[redirect] contain the file descriptor number (16751) --- Src/Zle/compcore.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'Src/Zle/compcore.c') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 1c3c31921..d92b492e3 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -618,6 +618,13 @@ callcompfunc(char *s, char *fn) } else compwords = (char **) zcalloc(sizeof(char *)); + if (compredirs) + freearray(compredirs); + if (rdstrs) + compredirs = bld_list_array(rdstrs); + else + compredirs = (char **) zcalloc(sizeof(char *)); + compparameter = ztrdup(compparameter); compredirect = ztrdup(compredirect); zsfree(compquote); @@ -1459,11 +1466,11 @@ set_comp_sep(void) return 0; } -/* This stores the strings from the list in an array. */ +/* This builds an array from a list of strings. */ /**/ -mod_export void -set_list_array(char *name, LinkList l) +mod_export char ** +bld_list_array(LinkList l) { char **a, **p; LinkNode n; @@ -1473,7 +1480,16 @@ set_list_array(char *name, LinkList l) *p++ = ztrdup((char *) getdata(n)); *p = NULL; - setaparam(name, a); + 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)); } /* Get the words from a variable or a (list of words). */ -- cgit 1.4.1