diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2008-04-10 20:55:25 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2008-04-10 20:55:25 (GMT) |
commit | d8c32484c433d2b8ec839afd17d842975a208c26 (patch) | |
tree | 5759c7413cef93580234aa0308a0546156c5eb11 /generic/tclIOCmd.c | |
parent | 91747044d3bf44d31f9c43f70666c9a4320767da (diff) | |
download | tcl-d8c32484c433d2b8ec839afd17d842975a208c26.zip tcl-d8c32484c433d2b8ec839afd17d842975a208c26.tar.gz tcl-d8c32484c433d2b8ec839afd17d842975a208c26.tar.bz2 |
* generic/tclIOCmd.c (Tcl_FcopyObjCmd): Keeping check for negative
values, changed to not be an error, but behave like the special
value -1 (copy all, default).
* tests/iocmd.test (iocmd-15.{12,13}): Removed.
* tests/io.test (io-52.5{,a,b}): Reverted last change, added
* tests/chanio.test (chan-io-52.5{,a,b}): comment regarding the
meaning of -1, added two more testcases for other negative values,
and input wrapped to negative.
FossilOrigin-Name: c5a22ce66b28b5c23efe228c2a042528afda0567
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r-- | generic/tclIOCmd.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 3c34845..00ca527 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.51.2.1 2008/04/09 18:36:18 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIOCmd.c,v 1.51.2.2 2008/04/10 20:55:26 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1644,18 +1644,13 @@ Tcl_FcopyObjCmd( return TCL_ERROR; } if (toRead<0) { - Tcl_WideInt w; - if (Tcl_GetWideIntFromObj(interp, objv[i+1], &w) != TCL_OK) { - return TCL_ERROR; - } - if (w >= (Tcl_WideInt)0) { - Tcl_AppendResult(interp, - "integer value to large to represent as 32bit signed value", - NULL); - } else { - Tcl_AppendResult(interp, "negative size forbidden", NULL); - } - return TCL_ERROR; + /* + * 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; case FcopyCommand: |