Skip to content
Tcl Source Code Artifact [94c3d7c33c]
Login

Artifact [94c3d7c33c]

Artifact 94c3d7c33c6f0531a2248f68a2e5224d5e2323d4:

Ticket change [94c3d7c33c] - New ticket [577033ffffffffff|577033ffff] <i>tcl_findLibrary sets &#39;varName&#39; on fail</i>. by vincentdarley on 2002-07-03 16:07:02.
D 2002-07-03T16:07:02
J assignee dgp
J cmimetype text/plain
J comment Basic\sproblem:\n\ntcl_findLibrary\sis\ssupposed\sto\sset\sthe\svariable\s\n$varName\sto\sthe\sdirectory\scontaining\sa\sspecific\s\nfile,\sif\sthat\sfile\sis\ssuccessfully\sfound\sand\ssourced.\s\s\nHowever,\sif\sthe\sprocedure\sis\sunable\sto\sfind\sthe\sfile,\s\nit\sstill\ssets\s$varName\sto\sthe\slast\slocation\sthat\swas\s\nlooked\sat.\s\sThis\scan\shave\sunfortunate\sside\seffects...\n\nExample\sof\sthe\sproblem:\n\nIf\sany\sextension\swants\sto\scall\stcl_findLibrary\stwice\s\n(because,\sperhaps\sfor\slegacy\sreasons,\sthe\spkg.tcl\s\nfile\sit\sis\slooking\sfor\scould\sbe\sin\stwo\sdifferent\s\nplaces),\sthen\sbetween\sthe\stwo\scalls,\sa\s'Tcl_UnsetVar\n(...,\s"myPkgVar",\sTCL_GLOBAL_ONLY)\sis\srequired.\n\nOtherwise\sthe\sfirst\scall\sto\stcl_findLibrary\s(which\swe\s\nwill\sassume\sfails)\sleaves\smyPkgVar\sset\sto\sthe\slast\s\ndirectory\sthat\swas\slooked\sat,\sand\sthen\sthe\ssecond\s\ncall\sto\stcl_findLibrary\swill\sonly\sexamine\sthat\s\nlocation.\n\nSuggested\ssolution:\n\nEither\sthis\sconstraint\sshould\sbe\sdocumented\sor\s\ntcl_findLibrary\sshould\sbe\sfixed\sso\sthat\s\nif\s'$varName'\sdoesn't\sexist\swhen\sit\sis\scalled,\sthen\sif\s\nthe\sprocedure\sfails,\s'$varName'\sshould\salso\snot\s\nexist\swhen\sthe\sprocedure\sreturns.\n
J foundin obsolete:\s8.4a5
J priority 5\sMedium
J resolution None
J status Open
J submitter vincentdarley
J subsystem 38.\sInit\s-\sLibrary\s-\sAutoload
J title tcl_findLibrary\ssets\s'varName'\son\sfail
J type Bug
K 577033ffffffffffffffffffffffffffffffffff
U vincentdarley
Z e19319621116a39c53e6dbea6c9c6f07