Skip to content
Tcl Source Code Artifact [f39f7d1218]
Login

Artifact [f39f7d1218]

Artifact f39f7d121843a9795c6162936b237f77faea2aaf:

Ticket change [f39f7d1218] - New ticket [491341ffffffffff|491341ffff] <i>GetsObj: trunc/append confusion @EOF </i>. by dgp on 2001-12-10 22:31:37.
D 2001-12-10T22:31:37
J assignee andreas_kupries
J cmimetype text/plain
J comment When\sTcl_GetsObj(chan,\sobj)\sreceives\san\sobj\sthat\nalready\shas\sa\snon-empty\sstring\srep,\sthe\sbytes\nread\sfrom\schan\sare\ssupposed\sto\sbe\sappended\sto\nthe\sexisting\sstring\srep.\s\sIt\sis\sincorrect\sto\nassume\sthat\sobj->bytes\sis\san\sempty\sstring.\n\nTcl_GetsObj()\sgets\sthis\sright\salmost\severywhere,\nbut\sthis\spart\sof\sthe\sspec\swas\sforgotten\sin\nlines\s3634-3644\sof\stclIO.c,\swhere\sEOF\shandling\ntakes\splace.\s\sThose\slines\sonly\swork\sif\sobj->bytes\npassed\sin\sis\san\sempty\sstring.\s\sSince\s[gets]\nalways\sdoes\spass\sin\ssuch\san\sempty\sTcl_Obj,\sthis\nbug\sisn't\svisible\sat\sthe\sscript\slevel,\sbut\sit\nshows\sup\sregularly\sin\sthe\scall\sat\sline\s300\sof\ntclMain.c.\s\sLines\s304-306\sof\stclMain.c\seven\nappear\sto\sbe\san\sawkward\sattempt\sto\swork\saround\sthis\nbug,\swithout\sever\sidentifying\sit\sas\sa\sbug.\n\nTo\sdemo\sthe\sbug,\screate\sa\sfile\stest.tcl\swith\na\ssingle\sline:\n\nif\s1\s{\n\nThen\sat\sa\sshell\sprompt\n\n$\stclsh\s<\stest.tcl\n\nThis\swill\sstick\stclsh\sin\san\sinfinite\sloop.\n\nAttached\sis\sthe\ssimple\spatch\sthat\scorrectly\ntests\sfor\s"no\scharacters\sread\s@\sEOF"\swhen\nobj->\sbytes\sis\snon-empty.
J foundin obsolete:\s8.4a4
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 25.\sChannel\sSystem
J title GetsObj:\strunc/append\sconfusion\s@EOF\s
J type Bug
K 491341ffffffffffffffffffffffffffffffffff
U dgp
Z 88bdcf7ba6de1292f7c41555692d9e3d