? tools/man2tcl
? unix/LOG
? unix/LOG.2
? unix/linux-static
? unix/linux-static2
? unix/linux-debug
? unix/linux-ix86
? unix/buffer.tcl
Index: generic/tclIO.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIO.c,v
retrieving revision 1.31
diff -u -r1.31 tclIO.c
--- generic/tclIO.c	2001/07/17 17:53:43	1.31
+++ generic/tclIO.c	2001/07/17 21:08:10
@@ -1701,6 +1701,17 @@
     }
 
     /*
+     * Only save buffers which are at least as big as the requested
+     * buffersize for the channel. This is to honor dynamic changes
+     * of the buffersize made by the user.
+     */
+
+    if ((bufPtr->bufLength - BUFFER_PADDING) < statePtr->bufSize) {
+        ckfree((char *) bufPtr);
+        return;
+    }
+
+    /*
      * Only save buffers for the input queue if the channel is readable.
      */
     
@@ -4994,6 +5005,19 @@
     } else {
 	bufPtr = statePtr->saveInBufPtr;
 	statePtr->saveInBufPtr = NULL;
+
+	/*
+	 * Check the actual buffersize against the requested
+	 * buffersize. Buffers which are smaller than requested aare
+	 * squashed. This is done to honor dynamic changes of the
+	 * buffersize made by the user.
+	 */
+
+	if ((bufPtr != NULL) && ((bufPtr->bufLength - BUFFER_PADDING) < statePtr->bufSize)) {
+	  ckfree((char *) bufPtr);
+	  bufPtr = NULL;
+	}
+
 	if (bufPtr == NULL) {
 	    bufPtr = AllocChannelBuffer(statePtr->bufSize);
 	}
