From 1268f477b0d88ff10b7de4dea33b53b29cbed287 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 13 Sep 2004 13:04:39 +0000 Subject: 20363: Src/init.c, Src/Zle/zle_main.c --- Src/Zle/zle_main.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Src/Zle') diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 5299c755b..80c0db6ed 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -688,17 +688,27 @@ zlecore(void) selectlocalmap(NULL); bindk = getkeycmd(); if (bindk) { - if (!ll && isfirstln && !(zlereadflags & ZLRF_IGNOREEOF) && - lastchar == eofchar) { + if (!ll && isfirstln && lastchar == eofchar) { /* * Slight hack: this relies on getkeycmd returning * a value for the EOF character. However, * undefined-key is fine. That's necessary because * otherwise we can't distinguish this case from * a ^C. + * + * The noxitct test is done in the top-level loop + * if zle is not running. As we trap EOFs at this + * level inside zle we need to mimic it here. + * If we break, the top-level loop will actually increment + * noexitct an extra time; that doesn't cause any + * problems. */ - eofsent = 1; - break; + if (!(zlereadflags & ZLRF_IGNOREEOF) || + ++noexitct >= 10) + { + eofsent = 1; + break; + } } if (execzlefunc(bindk, zlenoargs)) handlefeep(zlenoargs); -- cgit 1.4.1