diff options
author | dkf <dkf@noemail.net> | 2010-03-20 15:39:46 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2010-03-20 15:39:46 (GMT) |
commit | fd57d2c61d1a5e755355918ceddbbadcafc9d5db (patch) | |
tree | 916de8cf08cd2e2b07d6c7faf71f6d89064d6233 /generic/tclIOCmd.c | |
parent | 4adf9a350a2a2ee4101dd9447335b799e93220dc (diff) | |
download | tcl-fd57d2c61d1a5e755355918ceddbbadcafc9d5db.zip tcl-fd57d2c61d1a5e755355918ceddbbadcafc9d5db.tar.gz tcl-fd57d2c61d1a5e755355918ceddbbadcafc9d5db.tar.bz2 |
Allow [fcopy] to move more than 2GB per call. Frederic Bonnet identified issue.
FossilOrigin-Name: a2e969549f11650b54c316e8525b5dfafa3ce879
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r-- | generic/tclIOCmd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index ae6fe62..2b45169 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOCmd.c,v 1.67 2010/02/24 10:32:17 dkf Exp $ + * RCS: @(#) $Id: tclIOCmd.c,v 1.68 2010/03/20 15:39:46 dkf Exp $ */ #include "tclInt.h" @@ -1462,7 +1462,7 @@ Tcl_SocketObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const socketOptions[] = { - "-async", "-myaddr", "-myport","-server", NULL + "-async", "-myaddr", "-myport", "-server", NULL }; enum socketOptions { SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_SERVER @@ -1640,7 +1640,8 @@ Tcl_FcopyObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel inChan, outChan; - int mode, i, toRead, index; + int mode, i, index; + Tcl_WideInt toRead; Tcl_Obj *cmdPtr; static const char *const switches[] = { "-size", "-command", NULL }; enum { FcopySize, FcopyCommand }; @@ -1682,16 +1683,17 @@ Tcl_FcopyObjCmd( } switch (index) { case FcopySize: - if (TclGetIntFromObj(interp, objv[i+1], &toRead) != TCL_OK) { + if (Tcl_GetWideIntFromObj(interp, objv[i+1], &toRead) != TCL_OK) { return TCL_ERROR; } - if (toRead<0) { + if (toRead < 0) { /* * Handle all negative sizes like -1, meaning 'copy all'. By * resetting toRead we avoid changes in the core copying * functions (which explicitly check for -1 and crash on any * other negative value). */ + toRead = -1; } break; |