diff options
author | dgp <dgp@noemail.net> | 2014-10-18 20:06:02 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2014-10-18 20:06:02 (GMT) |
commit | ca5811397c4c0680905e34c9cc408c0d06ef879a (patch) | |
tree | 23020581d5324f4af1753744de8a7facf5198ecb /generic | |
parent | 0a35fbdb251d36074e195c51badb62cf99abfa63 (diff) | |
parent | 1bbadd9bf193501e2c019fccee2cb010b1b410a2 (diff) | |
download | tcl-ca5811397c4c0680905e34c9cc408c0d06ef879a.zip tcl-ca5811397c4c0680905e34c9cc408c0d06ef879a.tar.gz tcl-ca5811397c4c0680905e34c9cc408c0d06ef879a.tar.bz2 |
merge 8.5
FossilOrigin-Name: b45b149a60f8e2e558e01e3502d54f0d771d1ee5
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index d1f22c1..0122ec9 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -4042,6 +4042,7 @@ Tcl_GetsObj( eof = NULL; inEofChar = statePtr->inEofChar; + ResetFlag(statePtr, CHANNEL_BLOCKED); while (1) { if (dst >= dstEnd) { if (FilterInputBytes(chanPtr, &gs) != 0) { @@ -4386,6 +4387,7 @@ TclGetsObjBinary( /* Only handle TCL_TRANSLATE_LF and TCL_TRANSLATE_CR */ eolChar = (statePtr->inputTranslation == TCL_TRANSLATE_LF) ? '\n' : '\r'; + ResetFlag(statePtr, CHANNEL_BLOCKED); while (1) { /* * Subtract the number of bytes that were removed from channel @@ -4674,6 +4676,12 @@ FilterInputBytes( */ read: + if (GotFlag(statePtr, CHANNEL_NONBLOCKING|CHANNEL_BLOCKED) + == (CHANNEL_NONBLOCKING|CHANNEL_BLOCKED)) { + gsPtr->charsWrote = 0; + gsPtr->rawRead = 0; + return -1; + } if (GetInput(chanPtr) != 0) { gsPtr->charsWrote = 0; gsPtr->rawRead = 0; @@ -4764,12 +4772,6 @@ FilterInputBytes( * some more, but avoid blocking on a non-blocking channel. */ - if (GotFlag(statePtr, CHANNEL_NONBLOCKING|CHANNEL_BLOCKED) - == (CHANNEL_NONBLOCKING|CHANNEL_BLOCKED)) { - gsPtr->charsWrote = 0; - gsPtr->rawRead = 0; - return -1; - } goto read; } } else { |