summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index c96a406..ae09690 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -7588,6 +7588,10 @@ Tcl_Eof(
ChannelState *statePtr = ((Channel *) chan)->state;
/* State of real channel structure. */
+ if (GotFlag(statePtr, CHANNEL_NONBLOCKING)
+ && GotFlag(statePtr, CHANNEL_ENCODING_ERROR) {
+ return 0;
+ }
return GotFlag(statePtr, CHANNEL_EOF) ? 1 : 0;
}
@@ -8283,7 +8287,7 @@ Tcl_SetChannelOption(
statePtr->inputEncodingFlags = TCL_ENCODING_START;
statePtr->outputEncodingState = NULL;
statePtr->outputEncodingFlags = TCL_ENCODING_START;
- ResetFlag(statePtr, CHANNEL_NEED_MORE_DATA);
+ ResetFlag(statePtr, CHANNEL_NEED_MORE_DATA|CHANNEL_ENCODING_ERROR);
UpdateInterest(chanPtr);
return TCL_OK;
} else if (HaveOpt(2, "-eofchar")) {