about summary refs log tree commit diff
path: root/Src/Zle/compcore.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-03-01 10:41:59 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-03-01 10:41:59 +0000
commit10490ec499fff7b932f92a0b19c7e5343a24761d (patch)
tree43681ce84c1148d06cecdbd0ada37b88362ca85c /Src/Zle/compcore.c
parent4b98b648dfb0b641ea9592b66c87365449723194 (diff)
downloadzsh-10490ec499fff7b932f92a0b19c7e5343a24761d.tar.gz
zsh-10490ec499fff7b932f92a0b19c7e5343a24761d.tar.xz
zsh-10490ec499fff7b932f92a0b19c7e5343a24761d.zip
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)
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r--Src/Zle/compcore.c24
1 files changed, 20 insertions, 4 deletions
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). */