<i>File normalization corner case of ... broken with -DUNICODE</i>.
by
.
D 2011-02-18T08:38:41
J assignee vincentdarley
J cmimetype text/plain
J comment Ran\sinto\sthe\sfollowing\scorner\scase\sas\sa\sresult\sof\sa\stypo\s-\sif\sa\spath\scomponent\scontains\s"..."\sor\s(more\sthan\stwo\sdots),\sthe\snormalized\sstring\sis\scorrupted.\n(bug\sis\sWINDOWS\sspecific)\n\ntkcon\ssession:\n\n(tcl)\s49\s%\spwd\nC:/Documents\sand\sSettings/ashok/My\sDocuments/src/twapi-exp/twapi/tcl\n(tcl)\s50\s%\sfile\snormalize\s[file\sjoin\s[pwd]\s...]\nC:/Documents\sand\sSettings/ashok/My\sDocuments/src/twapi-exp/twapi/tcltcl\s(more\snon-printable\schars\shere)\n\nThe\sproblem\swas\sa\sbroken\scalculation\sin\sTclpObjNormalizePath\swhen\sUNICODE\sis\sdefined.\sThe\spatch\sto\sfix\sthis\sis\s:\n\n***\stclWinFile.c.orig\s\s\s2011-02-18\s09:19:45.750000000\s+0530\n---\stclWinFile.c\s\s\s\s\s\s\s\s2011-02-18\s13:45:03.750000000\s+0530\n***************\sTclpObjNormalizePath(\n***\s2778,2786\s****\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\spath\ssegment\sand\scontinue.\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sTcl_DStringAppend(&dsNorm,\s(const\schar\s*)\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s((WCHAR\s*)(nativePath\s+\sTcl_DStringLength(&ds))\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s-\sdotLen),\s(int)(dotLen\s*\ssizeof(WCHAR)));\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sNormal\spath.\n---\s2778,2788\s----\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\spath\ssegment\sand\scontinue.\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sTcl_DStringAppend(&dsNorm,\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s((const\schar\s*)\snativePath)\s+\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sTcl_DStringLength(&ds)\s/*\s#\sbytes,\snot\sTCHARS\s*/\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s-\s(dotLen\s*\ssizeof(TCHAR)),\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(int)(dotLen\s*\ssizeof(WCHAR)));\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sNormal\spath.\n\nAfter\spatching,\soutput\sis\sas\sfollows\s:\n\n%\sfile\snormalize\s[file\sjoin\s[pwd]\s...]\nC:/Documents\sand\sSettings/ashok/My\sDocuments/src/twapi-exp/twapi/tcl/...\n\nwhich\smatches\sTcl\s8.5\sbehavour.\n\nNote\sthis\sbehaviour\shas\sa\sseparate\sissue\s-\streatment\sof\s...\sis\sdifferent\sfrom\sWindows\ssemantics.\sThat\sis\slogged\sas\sa\sseparate\sbug.
J foundin obsolete:\s8.6b1.1
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter apnadkarni
J subsystem 36.\sPathname\sManagement
J title File\snormalization\scorner\scase\sof\s...\sbroken\swith\s-DUNICODE
J type Bug
K 3185609fffffffffffffffffffffffffffffffff
U apnadkarni
Z a1d398884101c0a8929c1fbd086b8331