summaryrefslogtreecommitdiffstats
path: root/generic/tclIOCmd.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-03-20 15:39:46 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-03-20 15:39:46 (GMT)
commit981ede1b28ef6c7040d9526a568faf7d7e6f73de (patch)
tree916de8cf08cd2e2b07d6c7faf71f6d89064d6233 /generic/tclIOCmd.c
parentebf2f83895304cba3d46bd0714bc6e1cf38fbe83 (diff)
downloadtcl-981ede1b28ef6c7040d9526a568faf7d7e6f73de.zip
tcl-981ede1b28ef6c7040d9526a568faf7d7e6f73de.tar.gz
tcl-981ede1b28ef6c7040d9526a568faf7d7e6f73de.tar.bz2
Allow [fcopy] to move more than 2GB per call. Frederic Bonnet identified issue.
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r--generic/tclIOCmd.c12
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;