From: SourceForge.net <no...@so...> - 2004-02-02 21:35:35
|
Bugs item #405995, was opened at 2001-03-05 03:34 Message generated for change (Settings changed) made by davygrvy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=405995&group_id=10894 Category: 24. Channel Commands Group: obsolete: 8.4a2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: David Gravereaux (davygrvy) Summary: Tcl_Ungets filling buffer wrongly Initial Comment: Tcl_Ungets puts the bytes into the beginning of the buffer, not staring at bufPtr->nextAdded. diff -r tcl8.3.2/generic/tclIO.c tcl8.3.2.new/generic/tclIO.c 4553c4553 < bufPtr->buf[i] = str[i]; --- > bufPtr->buf[bufPtr->nextAdded++] = str[i]; 4555d4554 < bufPtr->nextAdded += len; ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-02-02 13:31 Message: Logged In: YES user_id=7549 atEnd is handled by the splice operation below this code. Fix applied to HEAD: tclIO.c -r1.70 ---------------------------------------------------------------------- Comment By: Jiang Wu (jiangwu) Date: 2004-02-02 11:41 Message: Logged In: YES user_id=966384 I tried this patch on 8.4.4 and it seems to work. Here is the diff against 8.4.4: cvs diff -u tclIO.c Index: tclIO.c ============================================== ===================== RCS file: /home/cvs/starvine/cvsroot/tcl/generic/tclIO.c,v retrieving revision 1.2 diff -u -r1.2 tclIO.c --- tclIO.c 11 Oct 2003 07:02:47 -0000 1.2 +++ tclIO.c 2 Feb 2004 19:36:55 -0000 @@ -5041,9 +5041,8 @@ bufPtr = AllocChannelBuffer(len); for (i = 0; i < len; i++) { - bufPtr->buf[i] = str[i]; + bufPtr->buf[bufPtr->nextAdded++] = str[i]; } - bufPtr->nextAdded += len; if (statePtr->inQueueHead == (ChannelBuffer *) NULL) { bufPtr->nextPtr = (ChannelBuffer *) NULL; ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2001-07-19 11:24 Message: Logged In: YES user_id=75003 Doesn't this have to take "atEnd" into account too ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=405995&group_id=10894 |