Overview
| Artifact ID: | ba2848232f73aed8ab4a0b31e8cbe11fa7c95396 |
|---|---|
| Ticket: | 219282ffffffffffffffffffffffffffffffffff
Tcl_SetChannelOption (-buffering line) working incorrectly |
| User & Date: | andreas_kupries on 2001-07-20 01:10:19 |
Changes
- closedate changed to: "2001-07-19T18:10:19"
- closer changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=75003 I have to declare this item as invalid. Here comes the explanation. puts <some-data> translates into a call to "Tcl_PutsObjCmd", which in turn calls "Tcl_WriteObj", which in turn calls "WriteChars" (in "tclIO.c"). The last procedure now does several things: EOL translation and conversion of the internal UTF-8 to the external encoding. For the first action (EOL-translation) the system goes over the input, translates and stores the result in a staging buffer. Whenever the staging buffer is full the result is handed to the UTF-8 conversion. This stages appends the result of the conversion to the current buffer in the out queue, or allocates a new one if the queue was empty. All of the above can result in breaking apart the data to write into several chunks, each in its own buffer. So it is possible for the first buffer to contain some full lines of the data to write and a partial line, without a closing \n. Still, the buffer does _contain full lines_ and thus has to be flushed according to the set buffering policy. So it is possible that a buffer is written which is not closed with a \n, even if policy "line" is set. It just has to contain at least one full line. That a partial line follows does not detract from the requirement to flush this buffer. The assumption you assert upon (end of buffer == \n) is simply not true.
- login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "andreas_kupries"