summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-01-24 22:33:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-01-24 22:33:30 (GMT)
commita90c8f158fc3ddbccb467195a1ddbf7a71a851d5 (patch)
treed4d91eed124d65192b67f058bd7007237df5c3b8 /generic/tclIO.c
parentabe23bfb4ef65eb899170e5ae7c4efc030294b31 (diff)
parentb6f970f792d9528b3ea467025e95d04e4b1b19f4 (diff)
downloadtcl-a90c8f158fc3ddbccb467195a1ddbf7a71a851d5.zip
tcl-a90c8f158fc3ddbccb467195a1ddbf7a71a851d5.tar.gz
tcl-a90c8f158fc3ddbccb467195a1ddbf7a71a851d5.tar.bz2
merge 8.5
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4a5d8f1..972cbd8 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3787,16 +3787,17 @@ WriteChars(
consumedSomething = 1;
while (consumedSomething && (srcLen + savedLF + endEncoding > 0)) {
consumedSomething = 0;
- stage = statePtr->outputStage;
- stageMax = statePtr->bufSize;
- stageLen = stageMax;
-
- toWrite = stageLen;
- if (toWrite > srcLen) {
- toWrite = srcLen;
- }
if (translate) {
+ stage = statePtr->outputStage;
+ stageMax = statePtr->bufSize;
+ stageLen = stageMax;
+
+ toWrite = stageLen;
+ if (toWrite > srcLen) {
+ toWrite = srcLen;
+ }
+
if (savedLF) {
/*
* A '\n' was left over from last call to TranslateOutputEOL()
@@ -3822,8 +3823,9 @@ WriteChars(
stageLen = stageMax;
}
} else {
- memcpy(stage, src, toWrite);
- stageLen = toWrite;
+ stage = (char *) src;
+ stageLen = srcLen;
+ toWrite = stageLen;
}
src += toWrite;
srcLen -= toWrite;