summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2001-12-12 22:32:35 (GMT)
committerandreas_kupries <akupries@shaw.ca>2001-12-12 22:32:35 (GMT)
commit7fe2a62464d5b7c7cd0ed1f5a0abf8daafd4ee34 (patch)
treecde1cbddbda471b364cd31936971af45b230c077 /generic
parent5f40c6221b5fef57dec3b1b96604a0391e831d23 (diff)
downloadtcl-7fe2a62464d5b7c7cd0ed1f5a0abf8daafd4ee34.zip
tcl-7fe2a62464d5b7c7cd0ed1f5a0abf8daafd4ee34.tar.gz
tcl-7fe2a62464d5b7c7cd0ed1f5a0abf8daafd4ee34.tar.bz2
* generic/tclIO.c (Tcl_GetsObj): Applied patch for bug #491341 as
provided by Don Porter <dgp@users.sourceforge.net>. Fixes assumption of having an empty Tcl_Obj to work with.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 982d6ff..22f22bc 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.41 2001/11/07 04:47:54 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.42 2001/12/12 22:32:35 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -3631,13 +3631,13 @@ Tcl_GetsObj(chan, objPtr)
if (statePtr->flags & CHANNEL_EOF) {
skip = 0;
eol = dstEnd;
- if (eol == objPtr->bytes) {
+ if (eol == objPtr->bytes + oldLength) {
/*
- * If we didn't produce any bytes before encountering EOF,
+ * If we didn't append any bytes before encountering EOF,
* caller needs to see -1.
*/
- Tcl_SetObjLength(objPtr, 0);
+ Tcl_SetObjLength(objPtr, oldLength);
CommonGetsCleanup(chanPtr, encoding);
copiedTotal = -1;
goto done;