.
D 2003-09-13T14:02:53
J assignee nobody
J cmimetype text/plain
J comment Applies\sto\sTcl\sVersion\s8.4.4\s\n\nIn\stclWinPipe.c,\sLine\s1588\nif\s(isspace(*start))\s{\s/*\sINTL:\sISO\sspace.\s*/\na\ssigned\schar\sis\spassed\sto\sisspace.\s\s\n\nFor\stwo\sreasons,\sthis\sis\sincorrect:\n\n1.\sThe\sstring\spointed\sto\sby\s'start'\sis\s\nsuppoed\sto\sbe\sUTF-8.\sIt\sdoes\snot\smake\s\nsense\sto\spass\sthe\sbytes\sof\san\sUTF-8\s\nstring\sto\sisspace\sunless\sthey\srepresent\s\na\ssingle\scharacter\s(i.\se.\sare\sin\sthe\s\nrange\s1\s-\s127)\n\n2.\sPassing\sa\snegative\svalue\s(*start\sis\sa\s\nsigned\schar!)\sto\sisspace\scauses\sthe\sVC6\s\nand\sVC.NET\sruntime\slibraries\sto\saccess\s\nmemory\soutside\sthe\slookup-table\sused\sby\s\nthe\sctype.h\sfunctions.\n\nSymptoms\sand\sconsequences:\n1.\sAccess\sto\sundefined\smemory\slocations\n2.\sArguments\smay\sbe\squoted\sunneccessarily\s\n\s\s\s(because\sisspace\sreturns\sincorrectly\strue)\n3.\sAssertion\sfails\sin\sDebug\sbuilds\sof\s\n\s\s\sVC.NET\s2003\sin\smain.test\s(e.\sg.\sMain-1.3)\n\s\s\s"File\sistype.c,\sLine\s68:\n\s\s\s\sExpression\s(unsigned)(c+1)\s<=\s256"\n\nHow\sto\sreproduce:\nfor\s1.:\sAssembly\slevel\sdebugger\sor\scode\sinspection\s\n\s\s\s\s\s\s\s\s\s(ctype.h\sfor\sVC6,\sistype.c\sfor\sVC.NET\s2003)\nfor\s2.:\sCode\sinspection\nfor\s3.:\swith\sVC.NET\srun\nnmake\s-f\smakefile.vc\sOPTS=threads,symbols\nnmake\s-f\smakefile.vc\sOPTS=threads,symbols\stest\nThe\sassertion\sshould\sproduce\sfour\sdialog\sboxes\n\nHow\sto\sfix:\nThe\sfollowing\schanges\swork\sfor\sVC.NET\sand\sshould\sbe\nportable\sacross\sall\scompilers:\n---\stclWinPipe.c-orig\s\s\s2003-09-13\s15:46:04\n+++\stclWinPipe.c\s\s\s\s\s\s\s\s2003-09-13\s15:48:47\n@@\s-1584,8\s+1584,11\s@@\n\s\s\s\s\s\s\s\sif\s(arg[0]\s==\s'\\0')\s{\n\s\s\s\s\s\s\s\s\s\s\s\squote\s=\s1;\n\s\s\s\s\s\s\s\s}\selse\s{\n-\s\s\s\s\s\s\s\s\s\s\sfor\s(start\s=\sarg;\s*start\s!=\s'\\0';\sstart++)\s{\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sif\s(isspace(*start))\s{\s/*\sINTL:\sISO\nspace.\s*/\n+\s\s\s\s\s\s\s\s\s\s\sint\scount;\n+\s\s\s\s\s\s\s\s\s\s\sfor\s(start\s=\sarg;\s*start\s!=\s'\\0';\sstart\s+=\ncount)\s{\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sTcl_UniChar\sch;\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\scount\s=\sTcl_UtfToUniChar(start,\s&ch);\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sif\s(Tcl_UniCharIsSpace(ch))\s{\s/*\sINTL:\nISO\sspace.\s*/\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\squote\s=\s1;\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sbreak;\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\n
J foundin obsolete:\s8.4.4
J priority 5\sMedium
J resolution None
J status Open
J submitter ronaldd
J subsystem None
J title incorrect\suse\sof\sisspace\sin\stclWinPipe.c
J type Bug
K 805605ffffffffffffffffffffffffffffffffff
U ronaldd
Z b84c8b0136b99cd0e10d1b44087dc9df