From 4c589fe59abd497046fce0ef8b7c86a244608fe2 Mon Sep 17 00:00:00 2001 From: hobbs Date: Sun, 20 Jan 2008 21:16:14 +0000 Subject: * generic/tclIO.c (TclGetsObjBinary): operate on topmost channel. [Bug 1869405] (Ficicchia) --- ChangeLog | 5 +++++ generic/tclIO.c | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4feb8cc..8454627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-20 Jeff Hobbs + + * generic/tclIO.c (TclGetsObjBinary): operate on topmost channel. + [Bug 1869405] (Ficicchia) + 2008-01-17 Don Porter * generic/tclCompExpr.c: Revision to preserve parsed intreps diff --git a/generic/tclIO.c b/generic/tclIO.c index c9b179c..4caa474 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.136 2007/12/13 15:23:17 dgp Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.137 2008/01/20 21:16:15 hobbs Exp $ */ #include "tclInt.h" @@ -3953,12 +3953,6 @@ Tcl_GetsObj( char *dst, *dstEnd, *eol, *eof; Tcl_EncodingState oldState; - /* - * This operation should occur at the top of a channel stack. - */ - - chanPtr = statePtr->topChanPtr; - if (CheckChannelErrors(statePtr, TCL_READABLE) != 0) { copiedTotal = -1; goto done; @@ -3976,6 +3970,12 @@ Tcl_GetsObj( return TclGetsObjBinary(chan, objPtr); } + /* + * This operation should occur at the top of a channel stack. + */ + + chanPtr = statePtr->topChanPtr; + bufPtr = statePtr->inQueueHead; encoding = statePtr->encoding; @@ -4316,6 +4316,12 @@ TclGetsObjBinary( int rawLen, byteLen, eolChar; unsigned char *dst, *dstEnd, *eol, *eof, *byteArray; + /* + * This operation should occur at the top of a channel stack. + */ + + chanPtr = statePtr->topChanPtr; + bufPtr = statePtr->inQueueHead; /* -- cgit v0.12