Skip to content
Tcl Source Code Artifact [af56e39f88]
Login

Artifact [af56e39f88]

Artifact af56e39f889b8f5baeed3a017b6758a76956591f:

Ticket change [af56e39f88] - Ticket [979879ffffffffff|979879ffff] <i>file isdirectory causing variable corruption?</i> status still Open with 4 other changes by vincentdarley on 2004-06-29 18:31:27.
D 2004-06-29T18:31:27
J icomment Logged\sIn:\sYES\s\nuser_id=32170\n\nIn\sTcl\s8.5\sthe\sproblem\sis\scaused\shere\sin\stclPathObj.c\s(line\n1590):\n\nTcl_AppendObjToObj(copy,\sfsPathPtr->normPathPtr);\n/*\s\n\s*\sNormalize\sthe\scombined\sstring,\sbut\sonly\sstarting\safter\n\s*\sthe\send\sof\sthe\spreviously\snormalized\s'dir'.\s\sThis\sshould\n\s*\sbe\smuch\sfaster!\s\sWe\suse\s'cwdLen-1'\sso\sthat\swe\sare\n\s*\salready\spointing\sat\sthe\sdir-separator\sthat\swe\sknow\sabout.\n\s*\sThe\snormalization\scode\swill\sactually\sstart\soff\sdirectly\n\s*\safter\sthat\sseparator.\n\s*/\nTclFSNormalizeToUniquePath(interp,\scopy,\scwdLen-1,\s\n\s\s(fsPathPtr->nativePathPtr\s==\sNULL\s?\s&clientData\s:\sNULL));\n\nwhere\swe\sare\scalling\sTclFSNormalizeToUniquePath\scontrary\sto\nits\sdocumentation,\swith\sa\sstring\swhich\smay\sstill\scontain\n'./'\sor\s'../'\ssequences\s(from\sfsPathPtr->normPathPtr).\n\nIt's\snot\sreally\sclear\swhere\sthe\sfix\sshould\sbe\s--\sperhaps\sthe\nspecial\s'joined'\spathObj\srepresentation\sshouldn't\sbe\sallowed\nif\sthe\ssecond\spart\shas\s'.'\sor\s'..'\ssequences,\sor\selse\sthis\nbit\sof\scode\sshown\sabove\sshould\sbe\scleverer,\sor\selse\sthe\nnative\snormalization\scode\sshould\sactually\scope\swith\sthe\nexistence\sof\ssuch\ssequences.\n\nThe\sproblem\soccurs\sbecause\sthe\sTclpObjNormalizePath\sroutine\ntries\sto\sfind\sthe\s'long,\sunique\spath\sname'\sfor\seach\spath\nsegment\s(one\sby\sone),\sand\stherefore\sturns\s'a/b/./c'\sinto\n'a/b/b/c'\s(since\sthe\sreal\sname\sof\s'.'\sis\s'b'\sin\sthis\scase).\n\sSimilar\sbugs\sexist\swith\s'..'.\s\s\n\nLastly\sI\sshould\sadd\sthat\sturning\son\s'TclNORM_LONG_PATH'\sin\ntclWinFile.c\sseems\sto\sfix\sthe\sproblem,\sat\sleast\sfor\sthe\ncases\sI've\stested\s(it\sactivates\sa\sdifferent\sversion\sof\sthe\nnormalization),\sbut\sI\sthink\sthat\sother\scases\smight\sstill\ntrigger\sa\sfailure.\n\nAnyway,\sthis\sis\stoo\shard\sfor\sa\squick\sfix,\sso\sit'll\stake\sme\nsome\stime\s(i.e.\suntil\sI\shave\ssome\stime)\s--\sothers\sare\svery\nwelcome\sto\slook\sinto\sit.\n
J login vincentdarley
J mimetype text/plain
J username vincentdarley
K 979879ffffffffffffffffffffffffffffffffff
U vincentdarley
Z bb7ae07fc20aac292a73b8e77ca453ec