From e4def842c0f4ed63df0196ac34ffdeb6a12304fe Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 8 Mar 2016 23:26:57 +0100 Subject: [PATCH] Make EOF error conditionally non-fatal (XB) When the ICS Chat window is open, an EOF fromkeyboard is ignored. --- backend.c | 2 +- dialogs.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index 2657808..b2cd7c3 100644 --- a/backend.c +++ b/backend.c @@ -1982,7 +1982,7 @@ read_from_player (InputSourceRef isr, VOIDSTAR closure, char *message, int count DisplayFatalError(_("Error reading from keyboard"), error, 1); } else if (gotEof++ > 0) { RemoveInputSource(isr); - DisplayFatalError(_("Got end of file from keyboard"), 0, 0); + DisplayFatalError(_("Got end of file from keyboard"), 0, 666); // [HGM] 666 is kludge to alert front end } } diff --git a/dialogs.c b/dialogs.c index 252fffa..6380b77 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2348,6 +2348,11 @@ DisplayFatalError (String message, int error, int status) { char buf[MSG_SIZ]; + if(status == 666) { // ignore this error when ICS Console window is up + if(shellUp[ChatDlg]) return; + status = 0; + } + errorExitStatus = status; if (error == 0) { fprintf(stderr, "%s: %s\n", programName, message); -- 1.7.0.4