diff options
author | dgp <dgp@users.sourceforge.net> | 2014-03-01 03:01:41 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-03-01 03:01:41 (GMT) |
commit | 6ac36ed52bd548be97ae7baa3022e822f6a1bdce (patch) | |
tree | 22b53c93b8bec225cd5676e10894486821b575ea /generic/tclIO.c | |
parent | cb2843a5786c9654bc4fb186b4b12cc4548deaa6 (diff) | |
download | tcl-6ac36ed52bd548be97ae7baa3022e822f6a1bdce.zip tcl-6ac36ed52bd548be97ae7baa3022e822f6a1bdce.tar.gz tcl-6ac36ed52bd548be97ae7baa3022e822f6a1bdce.tar.bz2 |
Fixups make the test suite almost pass (except *io-39.17)
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 7b798af..139a05e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -5289,7 +5289,7 @@ ReadChars( dst = TclGetString(objPtr) + numBytes; } -#if 0 +#if 1 /* * This routine is burdened with satisfying several constraints. @@ -5373,6 +5373,7 @@ ReadChars( * a proper srcRead value. At this point, there * are no chars before the eof char in the buffer. */ + Tcl_SetObjLength(objPtr, numBytes); return -1; } @@ -5459,7 +5460,6 @@ ReadChars( statePtr->inputEncodingFlags &= ~TCL_ENCODING_START; Tcl_SetObjLength(objPtr, numBytes + 1); - // *offsetPtr += 1; return 1; } @@ -5473,7 +5473,6 @@ ReadChars( dst[0] = '\r'; bufPtr->nextRemoved = bufPtr->nextAdded; Tcl_SetObjLength(objPtr, numBytes + 1); - //*offsetPtr += 1; return 1; } @@ -5518,6 +5517,7 @@ ReadChars( if (srcLen > 0) { SetFlag(statePtr, CHANNEL_NEED_MORE_DATA); } + Tcl_SetObjLength(objPtr, numBytes); return -1; } @@ -5542,6 +5542,7 @@ ReadChars( memcpy(RemovePoint(nextPtr), src, (size_t) srcLen); RecycleBuffer(statePtr, bufPtr, 0); statePtr->inQueueHead = nextPtr; + Tcl_SetObjLength(objPtr, numBytes); return ReadChars(statePtr, objPtr, charsToRead, factorPtr); } @@ -5552,7 +5553,6 @@ ReadChars( *factorPtr = dstWrote * UTF_EXPANSION_FACTOR / srcRead; } Tcl_SetObjLength(objPtr, numBytes + dstWrote); - //*offsetPtr += dstWrote; return numChars; } @@ -5850,9 +5850,8 @@ TranslateInputEOL( if (*src == '\r') { src++; if (src >= srcMax) { -SetFlag(statePtr, INPUT_NEED_NL); -// src--; -// break; + src--; + break; } else if (*src == '\n') { *dst++ = *src++; } else { |