about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-14 08:16:45 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-14 08:16:45 +0000
commit90c6d73b568cd48c9cad0ae511c5605a9f4c1203 (patch)
tree695dbfd2932de638fe949aac6ef55e6df704de47
parent135b181aa6428bafa62b5029bfd944e88a20fa9c (diff)
downloadzsh-90c6d73b568cd48c9cad0ae511c5605a9f4c1203.tar.gz
zsh-90c6d73b568cd48c9cad0ae511c5605a9f4c1203.tar.xz
zsh-90c6d73b568cd48c9cad0ae511c5605a9f4c1203.zip
make all builtins in computil test if they were called from a completion function (12610)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/computil.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7dc510610..5c715a46c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-14  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12610: Src/Zle/computil.c: make all builtins in computil test if
+ 	they were called from a completion function
+	
 2000-08-13  Bart Schaefer  <schaefer@zsh.org>
 
 	* 12604: Src/compat.c, Src/system.h, Src/Modules/files.c,
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index fcc79b2c4..b42e2a4c5 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2587,6 +2587,10 @@ bin_compquote(char *nam, char **args, char *ops, int func)
     struct value vbuf;
     Value v;
 
+    if (incompfunc != 1) {
+	zwarnnam(nam, "can only be called from completion function", NULL, 0);
+	return 1;
+    }
     /* Anything to do? */
 
     if (!compqstack || !*compqstack)
@@ -3547,6 +3551,10 @@ cf_remove_other(char **names, char *pre, int *amb)
 static int
 bin_compfiles(char *nam, char **args, char *ops, int func)
 {
+    if (incompfunc != 1) {
+	zwarnnam(nam, "can only be called from completion function", NULL, 0);
+	return 1;
+    }
     if (**args != '-') {
 	zwarnnam(nam, "missing option: %s", *args, 0);
 	return 1;
@@ -3640,6 +3648,10 @@ bin_compgroups(char *nam, char **args, char *ops, int func)
     Heap oldheap;
     char *n;
 
+    if (incompfunc != 1) {
+	zwarnnam(nam, "can only be called from completion function", NULL, 0);
+	return 1;
+    }
     SWITCHHEAPS(oldheap, compheap) {
 	while ((n = *args++)) {
 	    endcmgroup(NULL);