Skip to content
Tcl Source Code Artifact [ffe6b06dd3]
Login

Artifact [ffe6b06dd3]

Artifact ffe6b06dd3b2509befaf4d9e4b146ef8f0ea3ce1:

Ticket change [ffe6b06dd3] - New ticket [3603434fffffffff|3603434fff] <i>Win TclpObjNormalizePath fails for non-existent drive</i>. by dgp on 2013-02-05 16:38:31.
D 2013-02-05T16:38:31
J assignee dgp
J cmimetype text/plain
J comment \nThe\sportions\sof\sfilesystem\spathname\shandling\sin\nthe\sgeneric/*.c\sfiles\sof\sTcl\sinclude\sspecial\sper-platform\nhandling\sof\s[file\spathtype]\squeries.\s\sIn\sparticular,\son\nWindows,\sany\spathname\sstarting\swith\s?:/\s,\swhere\s?\nis\sany\ssingle\sbyte,\sgets\slabeled\sas\san\sabsolute\spath\nbased\son\sthe\sassumption\sthat\sit's\sa\sdrive\sdesignation.\nThis\shappens\swhether\sor\snot\ssuch\sa\sdrive\sis\sactually\non\sthe\ssystem.\n\nOver\sin\sthe\stclWinFile.c\simplementation\sof\nTclpObjNormalizePath(),\sthough,\sa\snormalization\nof\s\sa\spath\sof\sthe\ssame\spattern,\ssay\s"a:/",\sis\smore\nconstrained.\s\sIf\sthe\s"a"\sdrive\sis\snot\sactually\son\nthe\ssystem\s(floppy\sdrives\sare\suncommon\snow),\nit\srefuses\sto\sdeclare\sthat\s"a:/"\sis\sa\snormalized\npathname.\s\sInstead,\sit\sclaims\s"a:"\sis\sa\snormalized\npathname,\sand\sleaves\sthe\srest\sfor\sother\sfilesystems\nto\scontinue\snormalizing.\s\sThis\sis\strouble\sand\sinconsistent.\nThe\scooperative\snormalization\sprocess\srelies\son\sworking\non\san\sabsolute\spathname,\sand\sthis\smisstep\sleaves\sus\nwith\sa\svolumerelative\sone.\s\sIt's\salso\sinconsistent\swith\sthe\nrules\simposed\sin\sthe\sgeneric\scode.\n\nMost\sof\sthe\stime\sthis\sbug\sis\sharmless,\sbecause\sno\sother\nfilesystem\sis\spresent\sor\smakes\san\seffort\sto\sclaim,\sand\sthe\nfinal\sfallback\sis\sto\sgive\sit\snative\sownership\sand\sjust\sassume\nwhat's\sleft\sis\snormalized.\s\sThis\sturns\sout\sto\sbe\scorrect.\s\sThe\nonly\stime\sthis\scauses\strouble\sis\swhen\sthe\s\nTcl_FSNormalizePathProc\sof\ssome\sother\sTcl_Filesystem\nrecursively\scalls\sfor\sa\sprefix\sof\sthe\spath\sto\sbe\snormalized\nas\spart\sof\sits\sown\sattempt\sto\snormalize\smore\sof\sthe\spath.\nFor\sexample,\sthis\sis\swhat\strofs\sdoes.\s\sThen\sthe\sbug\sleads\nto\sendless\srecursion\sand\sa\scrash\swhen\sthe\sstack\sis\sexhausted.\nThanks\sto\sBrian\sGriffin\sfor\staking\snotice\sof\sthis.\s\sDemonstration\nisn't\sdifficult.\s\sOn\sWindows,\sbring\strofs\sinto\san\sinterp\sand\sthen\nattempt\sa\s[glob\sa:/]\son\sa\ssystem\swith\sno\sA:\sdrive.\s\sCRASH!\n\nThe\ssimplest\sway\sto\srestore\sconsistency\sis\sto\smake\ssure\s\nTclpObjNormalizePath\sclaims\sthe\sfirst\s/\sin\sthe\spath\sas\spart\nof\sa\snormalized\spath,\swhether\sor\snot\sthe\sdrive\sexists\son\nthe\ssystem.\s\sThen\sthe\sassumptions\sof\sthe\scooperative\nnormalization\samong\sTcl_Filesystems\sare\smaintained\sand\ncrashes\sare\savoided.\n\nTo\sbe\sclear,\sthis\sis\snot\sthe\s"most\scorrect"\ssolution.\s\sGetting\nsomething\smore\scorrect\sinvolves\ssome\sserious\srewriting\sso\nthat\splatform\sprocessing\sis\sbetter\scontained\sin\splatform\sfiles.\nThis\sis\sa\sminimal\sconsistency\sand\ssanity\sand\scrash\sprevention\nfix\sgiven\sthe\sstate\sof\sthings\sas\sthey\sare.
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 36.\sPathname\sManagement
J title Win\sTclpObjNormalizePath\sfails\sfor\snon-existent\sdrive
J type Bug
K 3603434fffffffffffffffffffffffffffffffff
U dgp
Z e5cf9c42464bd3fbd25d8ea80de5a5b3