diff options
author | dgp <dgp@noemail.net> | 2014-10-18 22:43:06 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2014-10-18 22:43:06 (GMT) |
commit | 02246bd4bcad3ea8ae508e3362827dab32be2d28 (patch) | |
tree | fbf1295b498c8fe72cd8c4029b8813e263f9c5c3 /generic | |
parent | a1bcb65d96d08c681232d16532980e2799366450 (diff) | |
parent | 1960ef9df14cd19d29b8e70a1548bc6cbb77f7e8 (diff) | |
download | tcl-02246bd4bcad3ea8ae508e3362827dab32be2d28.zip tcl-02246bd4bcad3ea8ae508e3362827dab32be2d28.tar.gz tcl-02246bd4bcad3ea8ae508e3362827dab32be2d28.tar.bz2 |
merge trunk
FossilOrigin-Name: 0a522a5abdfeddaa7b2ec10005ffa8cbf69c9fef
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 9283bf5..207ce19 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -4453,6 +4453,7 @@ Tcl_GetsObj( eof = NULL; inEofChar = statePtr->inEofChar; + ResetFlag(statePtr, CHANNEL_BLOCKED); while (1) { if (dst >= dstEnd) { if (FilterInputBytes(chanPtr, &gs) != 0) { @@ -4801,6 +4802,7 @@ TclGetsObjBinary( eolChar = (statePtr->inputTranslation == TCL_TRANSLATE_LF) ? '\n' : '\r'; + ResetFlag(statePtr, CHANNEL_BLOCKED); while (1) { /* * Subtract the number of bytes that were removed from channel @@ -5089,6 +5091,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; @@ -5179,12 +5187,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 { |