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 edce09b..0e80fd5 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -5862,7 +5862,11 @@ DoReadChars(
&& (statePtr->inputTranslation == TCL_TRANSLATE_LF)
&& (statePtr->inEofChar == '\0');
- if (appendFlag == 0) {
+ if (appendFlag) {
+ if (binaryMode && (NULL == TclGetBytesFromObj(NULL, objPtr, NULL))) {
+ binaryMode = 0;
+ }
+ } else {
if (binaryMode) {
Tcl_SetByteArrayLength(objPtr, 0);
} else {