From 757168e2c8af374436108266cc3cfd32a946a590 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 16 Jan 2001 13:44:18 +0000 Subject: remove 13108 (trap queues); replace with signal queueing to ensure that user signal handlers are only executed when it is safe to run them (13365) --- Src/Zle/zle_tricky.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Src/Zle/zle_tricky.c') diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index d6250ce23..7476b833b 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -535,24 +535,33 @@ parambeg(char *s) static int docomplete(int lst) { + static int active = 0; + char *s, *ol; int olst = lst, chl = 0, ne = noerrs, ocs, ret = 0, dat[2]; + if (active) { + zwarn("completion cannot be used recursively (yet)", NULL, 0); + return 1; + } + active = 1; if (undoing) setlastline(); if (!module_loaded("zsh/complete")) load_module("zsh/compctl"); - if (runhookdef(BEFORECOMPLETEHOOK, (void *) &lst)) + if (runhookdef(BEFORECOMPLETEHOOK, (void *) &lst)) { + active = 0; return 0; - + } /* Expand history references before starting completion. If anything * * changed, do no more. */ - if (doexpandhist()) + if (doexpandhist()) { + active = 0; return 0; - + } metafy_line(); ocs = cs; @@ -608,6 +617,7 @@ docomplete(int lst) unmetafy_line(); zsfree(s); zsfree(qword); + active = 0; return 1; } ocs = cs; @@ -785,6 +795,7 @@ docomplete(int lst) dat[1] = ret; runhookdef(AFTERCOMPLETEHOOK, (void *) dat); + active = 0; return dat[1]; } -- cgit 1.4.1