about summary refs log tree commit diff
diff options
context:
space:
mode:
-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);