From d24593bf3862046a4093226f21ce276bd23d0ae3 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 2 Sep 2004 09:20:35 +0000 Subject: 20300: fix spurious EOF from ^C --- ChangeLog | 5 +++++ Src/Zle/zle_main.c | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3676b8424..803eeace0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-02 Peter Stephenson + + * 20300: Src/Zle/zle_main.c: typing ^D to list completions, + then two ^C's caused a spurious EOF. + 2004-08-24 Wayne Davison * 20283: Completion/Unix/Command/_ant: Improved the parsing 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(); -- cgit 1.4.1