summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--generic/tclEncoding.c4
-rw-r--r--generic/tclIO.c34
3 files changed, 29 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 00a7a3c..fab1845 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-03-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tclEncoding.c: Fix typo in comment.
+ * generic/tclIO.c (DoReadChars, ReadBytes, ReadChars):
+ Use NULL value instead of pointer set to NULL to make
+ things more clear. Reorder arguments so that they
+ match the function signatures. Cleanup little typos
+ and add more descriptive comment.
+
2002-03-08 Mo DeJong <mdejong@users.sourceforge.net>
* win/README: Update to indicate that Mingw 1.1 is
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index b974e04..b61c92d 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.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: tclEncoding.c,v 1.11 2002/03/04 22:00:39 hobbs Exp $
+ * RCS: @(#) $Id: tclEncoding.c,v 1.12 2002/03/11 20:43:07 mdejong Exp $
*/
#include "tclInt.h"
@@ -835,7 +835,7 @@ Tcl_ExternalToUtfDString(encoding, src, srcLen, dstPtr)
*
* Tcl_ExternalToUtf --
*
- * Convert a source buffer from the specified encoding into UTF-8,
+ * Convert a source buffer from the specified encoding into UTF-8.
*
* Results:
* The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE,
diff --git a/generic/tclIO.c b/generic/tclIO.c
index cefab6c..7c775b3 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.53 2002/03/02 04:55:31 hobbs Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.54 2002/03/11 20:43:10 mdejong Exp $
*/
#include "tclInt.h"
@@ -4380,7 +4380,7 @@ DoReadChars(chanPtr, objPtr, toRead, appendFlag)
RecycleBuffer(statePtr, bufPtr, 0);
statePtr->inQueueHead = nextPtr;
if (nextPtr == NULL) {
- statePtr->inQueueTail = nextPtr;
+ statePtr->inQueueTail = NULL;
}
}
}
@@ -4452,19 +4452,19 @@ DoReadChars(chanPtr, objPtr, toRead, appendFlag)
static int
ReadBytes(statePtr, objPtr, bytesToRead, offsetPtr)
ChannelState *statePtr; /* State of the channel to read. */
- int bytesToRead; /* Maximum number of characters to store,
- * or < 0 to get all available characters.
- * Characters are obtained from the first
- * buffer in the queue -- even if this number
- * is larger than the number of characters
- * available in the first buffer, only the
- * characters from the first buffer are
- * returned. */
Tcl_Obj *objPtr; /* Input data is appended to this ByteArray
* object. Its length is how much space
* has been allocated to hold data, not how
* many bytes of data have been stored in the
* object. */
+ int bytesToRead; /* Maximum number of bytes to store,
+ * or < 0 to get all available bytes.
+ * Bytes are obtained from the first
+ * buffer in the queue -- even if this number
+ * is larger than the number of bytes
+ * available in the first buffer, only the
+ * bytes from the first buffer are
+ * returned. */
int *offsetPtr; /* On input, contains how many bytes of
* objPtr have been used to hold data. On
* output, filled with how many bytes are now
@@ -4556,6 +4556,10 @@ ReadBytes(statePtr, objPtr, bytesToRead, offsetPtr)
static int
ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
ChannelState *statePtr; /* State of channel to read. */
+ Tcl_Obj *objPtr; /* Input data is appended to this object.
+ * objPtr->length is how much space has been
+ * allocated to hold data, not how many bytes
+ * of data have been stored in the object. */
int charsToRead; /* Maximum number of characters to store,
* or -1 to get all available characters.
* Characters are obtained from the first
@@ -4564,10 +4568,6 @@ ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
* available in the first buffer, only the
* characters from the first buffer are
* returned. */
- Tcl_Obj *objPtr; /* Input data is appended to this object.
- * objPtr->length is how much space has been
- * allocated to hold data, not how many bytes
- * of data have been stored in the object. */
int *offsetPtr; /* On input, contains how many bytes of
* objPtr have been used to hold data. On
* output, filled with how many bytes are now
@@ -4705,7 +4705,9 @@ ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
if (TranslateInputEOL(statePtr, dst, dst, &dstWrote, &dstRead) != 0) {
/*
* Hit EOF char. How many bytes of src correspond to where the
- * EOF was located in dst?
+ * EOF was located in dst? Run the conversion again with an
+ * output buffer just big enough to hold the data so we can
+ * get the correct value for srcRead.
*/
if (dstWrote == 0) {
@@ -5196,7 +5198,7 @@ GetInput(chanPtr)
/*
* Check the actual buffersize against the requested
- * buffersize. Buffers which are smaller than requested aare
+ * buffersize. Buffers which are smaller than requested are
* squashed. This is done to honor dynamic changes of the
* buffersize made by the user.
*/