summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-02-02 22:00:30 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-02-02 22:00:30 (GMT)
commit8d1e9cca9040816aaa0ffc543e47181085c3f9a2 (patch)
tree5600b3fd31ece1be5485576e1be71904eadc652b /generic/tclIO.c
parent20830f1de990be20541f5a22ef27c99aeeb0174d (diff)
downloadtcl-8d1e9cca9040816aaa0ffc543e47181085c3f9a2.zip
tcl-8d1e9cca9040816aaa0ffc543e47181085c3f9a2.tar.gz
tcl-8d1e9cca9040816aaa0ffc543e47181085c3f9a2.tar.bz2
* generic/tclIO.c (Tcl_Ungets): fixes improper filling of the channel buffer.
[Bug 405995]
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 6ef2b5e..51a105b 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.61.2.2 2003/04/11 17:35:33 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.61.2.3 2004/02/02 22:00:30 davygrvy Exp $
*/
#include "tclInt.h"
@@ -5041,9 +5041,8 @@ Tcl_Ungets(chan, str, len, atEnd)
bufPtr = AllocChannelBuffer(len);
for (i = 0; i < len; i++) {
- bufPtr->buf[i] = str[i];
+ bufPtr->buf[bufPtr->nextAdded++] = str[i];
}
- bufPtr->nextAdded += len;
if (statePtr->inQueueHead == (ChannelBuffer *) NULL) {
bufPtr->nextPtr = (ChannelBuffer *) NULL;