From b199de25aaa631078acc7cd5e5f562d7c46485f3 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 20 Mar 2010 17:53:07 +0000 Subject: * generic/tclIO.c (CopyData): Allow the total number of bytes copied by [fcopy] to exceed 2GB. Can happen when no -size parameter given. --- ChangeLog | 19 ++++++++++++------- generic/tclIO.c | 9 +++++---- generic/tclIO.h | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3193aca..a192b43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,20 +1,25 @@ +2010-03-20 Donal K. Fellows + + * generic/tclIO.c (CopyData): Allow the total number of bytes copied + by [fcopy] to exceed 2GB. Can happen when no -size parameter given. + 2010-03-18 Don Porter - * generic/tclListObj.c: Prevent in overflow trouble in ListObjReplace - * generic/tclTestObj.c: operations. Thanks to kbk for fix and test. - * tests/listObj.test: [Bug 2971669]. + * generic/tclListObj.c: [Bug 2971669]: Prevent in overflow trouble in + * generic/tclTestObj.c: ListObjReplace operations. Thanks to kbk for + * tests/listObj.test: fix and test. 2010-03-12 Jan Nijtmans - * win/makefile.vc Fix [Bug 2967340]: Static build failure + * win/makefile.vc: Fix [Bug 2967340]: Static build failure * win/.cvsignore 2010-03-09 Andreas Kupries * generic/tclIORChan.c: [Bug 2936225]: Thanks to Alexandre Ferrieux - * doc/refchan.n: for debugging and fixing - * tests/ioCmd.test: the problem. It is the write-side equivalent - to the bug fixed 2009-08-06. + * doc/refchan.n: for debugging + * tests/ioCmd.test: and fixing the problem. It is the write-side + equivalent to the bug fixed 2009-08-06. 2010-03-09 Don Porter diff --git a/generic/tclIO.c b/generic/tclIO.c index 1c3ba79..ebbb3d1 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.137.2.16 2010/01/18 22:20:56 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.137.2.17 2010/03/20 17:53:07 dkf Exp $ */ #include "tclInt.h" @@ -8605,7 +8605,8 @@ CopyData( Tcl_Obj *cmdPtr, *errObj = NULL, *bufObj = NULL, *msg = NULL; Tcl_Channel inChan, outChan; ChannelState *inStatePtr, *outStatePtr; - int result = TCL_OK, size, total, sizeb; + int result = TCL_OK, size, sizeb; + Tcl_WideInt total; char *buffer; int inBinary, outBinary, sameEncoding; /* Encoding control */ @@ -8863,7 +8864,7 @@ CopyData( StopCopy(csPtr); Tcl_Preserve(interp); - Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewIntObj(total)); + Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewWideIntObj(total)); if (errObj) { Tcl_ListObjAppendElement(interp, cmdPtr, errObj); } @@ -8882,7 +8883,7 @@ CopyData( result = TCL_ERROR; } else { Tcl_ResetResult(interp); - Tcl_SetObjResult(interp, Tcl_NewIntObj(total)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(total)); } } } diff --git a/generic/tclIO.h b/generic/tclIO.h index eab83eb..626ecba 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -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.h,v 1.11.2.1 2008/04/07 22:33:30 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.h,v 1.11.2.2 2010/03/20 17:53:07 dkf Exp $ */ /* @@ -43,7 +43,7 @@ typedef struct CopyState { int readFlags; /* Original read channel flags. */ int writeFlags; /* Original write channel flags. */ int toRead; /* Number of bytes to copy, or -1. */ - int total; /* Total bytes transferred (written). */ + Tcl_WideInt total; /* Total bytes transferred (written). */ Tcl_Interp *interp; /* Interp that started the copy. */ Tcl_Obj *cmdPtr; /* Command to be invoked at completion. */ int bufSize; /* Size of appended buffer. */ -- cgit v0.12