From 90c6d73b568cd48c9cad0ae511c5605a9f4c1203 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 14 Aug 2000 08:16:45 +0000 Subject: make all builtins in computil test if they were called from a completion function (12610) --- ChangeLog | 5 +++++ Src/Zle/computil.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7dc510610..5c715a46c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-08-14 Sven Wischnowsky + + * 12610: Src/Zle/computil.c: make all builtins in computil test if + they were called from a completion function + 2000-08-13 Bart Schaefer * 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); -- cgit 1.4.1