about summary refs log tree commit diff
path: root/Src/Zle/zle_main.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2004-09-20 13:37:41 +0000
committerBart Schaefer <barts@users.sourceforge.net>2004-09-20 13:37:41 +0000
commit2e9bbdc833ca50f4d1a4613c1e0f2035fc5f9561 (patch)
treee179ab8e1b1e1ded3a7a9f2202e334c899d062c2 /Src/Zle/zle_main.c
parent037485c4a474395064e2b5b1da281ca052796320 (diff)
downloadzsh-2e9bbdc833ca50f4d1a4613c1e0f2035fc5f9561.tar.gz
zsh-2e9bbdc833ca50f4d1a4613c1e0f2035fc5f9561.tar.xz
zsh-2e9bbdc833ca50f4d1a4613c1e0f2035fc5f9561.zip
20387: revised algorithm for the fix in 20363.
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r--Src/Zle/zle_main.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 80c0db6ed..2f78db1d1 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -688,30 +688,23 @@ zlecore(void)
 	selectlocalmap(NULL);
 	bindk = getkeycmd();
 	if (bindk) {
-	    if (!ll && isfirstln && lastchar == eofchar) {
+	    if (!ll && isfirstln && !(zlereadflags & ZLRF_IGNOREEOF) &&
+		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.
 		 */
-		if (!(zlereadflags & ZLRF_IGNOREEOF) ||
-		    ++noexitct >= 10)
-		{
-		    eofsent = 1;
-		    break;
-		}
+		eofsent = 1;
+		break;
 	    }
-	    if (execzlefunc(bindk, zlenoargs))
+	    if (execzlefunc(bindk, zlenoargs)) {
 		handlefeep(zlenoargs);
+		if (eofsent)
+		    break;
+	    }
 	    handleprefixes();
 	    /* for vi mode, make sure the cursor isn't somewhere illegal */
 	    if (invicmdmode() && cs > findbol() &&
@@ -908,6 +901,7 @@ execzlefunc(Thingy func, char **args)
 	    !ll && isfirstln && (zlereadflags & ZLRF_IGNOREEOF)) {
 	    showmsg((!islogin) ? "zsh: use 'exit' to exit." :
 		    "zsh: use 'logout' to logout.");
+	    eofsent = 1;
 	    ret = 1;
 	} else {
 	    if(!(wflags & ZLE_KEEPSUFFIX))