diff options
author | mdejong <mdejong> | 2003-03-06 09:16:12 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2003-03-06 09:16:12 (GMT) |
commit | a060bfc83abd3ede4e970cef1959af6d9f75946e (patch) | |
tree | beb16481c0323e16d75fa932bc0f7e7b91f5ca94 /generic/tclIO.c | |
parent | ee86aa6fca4bdbb2d897e973b48b0cf1f704820d (diff) | |
download | tcl-a060bfc83abd3ede4e970cef1959af6d9f75946e.zip tcl-a060bfc83abd3ede4e970cef1959af6d9f75946e.tar.gz tcl-a060bfc83abd3ede4e970cef1959af6d9f75946e.tar.bz2 |
* generic/tclIO.c (Tcl_SetChannelOption):
Invoke the Tcl_SetChannelBufferSize method
as a result of changing the -buffersize
option to fconfigure. The previous
implementation used some inlined code that
reset the buffer size to the default size
instead of ignoring the request as
implemented in Tcl_SetChannelBufferSize.
* tests/io.test: Update test case so that
it actually checks the implementation of
Tcl_SetChannelBufferSize.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 556a2fe..250fd2c 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.61 2003/02/19 01:04:57 hobbs Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.62 2003/03/06 09:16:19 mdejong Exp $ */ #include "tclInt.h" @@ -6393,10 +6393,8 @@ Tcl_SetChannelOption(interp, chan, optionName, newValue) return TCL_OK; } else if ((len > 7) && (optionName[1] == 'b') && (strncmp(optionName, "-buffersize", len) == 0)) { - statePtr->bufSize = atoi(newValue); /* INTL: "C", UTF safe. */ - if ((statePtr->bufSize < 10) || (statePtr->bufSize > (1024 * 1024))) { - statePtr->bufSize = CHANNELBUFFER_DEFAULT_SIZE; - } + Tcl_SetChannelBufferSize(chan, + atoi(newValue)); /* INTL: "C", UTF safe. */ } else if ((len > 2) && (optionName[1] == 'e') && (strncmp(optionName, "-encoding", len) == 0)) { Tcl_Encoding encoding; |