about summary refs log tree commit diff
path: root/Src/Zle/zle_main.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-09-02 09:20:35 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-09-02 09:20:35 +0000
commitd24593bf3862046a4093226f21ce276bd23d0ae3 (patch)
treea120d6d70c111b7bbe5c24604733b435ad1f6530 /Src/Zle/zle_main.c
parent7f2db6916e4f6bf4b221b51e8691b0c65fafdea5 (diff)
downloadzsh-d24593bf3862046a4093226f21ce276bd23d0ae3.tar.gz
zsh-d24593bf3862046a4093226f21ce276bd23d0ae3.tar.xz
zsh-d24593bf3862046a4093226f21ce276bd23d0ae3.zip
20300: fix spurious EOF from ^C
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r--Src/Zle/zle_main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 97d5432be..5299c755b 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -687,12 +687,19 @@ zlecore(void)
 	reselectkeymap();
 	selectlocalmap(NULL);
 	bindk = getkeycmd();
-	if (!ll && isfirstln && !(zlereadflags & ZLRF_IGNOREEOF) &&
-	    lastchar == eofchar) {
-	    eofsent = 1;
-	    break;
-	}
 	if (bindk) {
+	    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.
+		 */
+		eofsent = 1;
+		break;
+	    }
 	    if (execzlefunc(bindk, zlenoargs))
 		handlefeep(zlenoargs);
 	    handleprefixes();