Skip to content
Tcl Source Code Artifact [aa62eea50e]
Login

Artifact [aa62eea50e]

Artifact aa62eea50e6a2f196c3f6383fbdbdc6bf4c08f02:

Ticket change [aa62eea50e] - New ticket [218871ffffffffff|218871ffff] <i>FIX for auto_mkindex/auto_load bugs on funny procedure names</i>. by nobody on 2000-10-26 01:07:00.
D 2000-10-26T01:07:00
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s2480\sBug\nVersion:\s8.2b1\nSubmitDate:\s'1999-08-02'\nLastModified:\s'2000-01-28'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\stechsupp\nChangedBy:\sericm\nRelatedBugIDs:\s2611\nOS:\sAll\nFixedDate:\s'2000-01-28'\nFixedInVersion:\s8.3\nClosedDate:\s'2000-10-25'\n\n\nName:\n\nKrzysztof\sKozminski\n\n\nCVS:\n\nRCS:\s@(#)\s$Id:\sauto.tcl,v\s1.2\s1999/04/16\s00:46:56\sstanton\sExp\s$\sand\sRCS:\s@(#)\s$Id:\sinit.tcl,v\s1.31\s1999/06/25\s23:29:53\swelch\sExp\s$\n\n\nComments:\n\nThe\n\n\s\s\s\sreturn\s[expr\s{[info\scommands\s$name]\s!=\s""}]\n\n\nline\sin\sproc\sauto_load\sshould\sbe\salso\sfixed\sto\squery\sthe\sappropriate\n\nnamespace\sfor\sthe\sorigin\sof\sthe\scommand,\sbut\sI\sdid\snot\shave\sany\sold\n\nauto_mkindex\sversions\sto\sgenerate\snon-canonical\sauto_index\sentries\sto\n\ntest\sthis\spart.\n\n\nAlso,\swhere\sis\stest\s"autoMkindex-3.3"\s?\s\sI\sjust\smight\stake\syou\sup\son\sthe\n\ngold\sstar\soffer\s:-)\n\n\nReproducibleScript:\n\nPrepare\sa\sfile\s/tmp/test.tcl\swith\sthe\sfollowing\scontents:\n\n\nproc\s{ugly*\s$procname\s[error\sGOTCHA!]}\s{some\sargs}\s{\n\n\s\s\s\sputs\s"$some\s$args"\n\n}\n\nproc\s{ugly*\\*\\\\*\s\\$\\\\$\\\\\\$procname\s[\\[\\\\[error\sGOTCHA!]]]}\s{some\sargs}\s{\n\n\s\s\s\sputs\s"$some\s$args"\n\n}\n\n\nInvoke\sprotclsh82\sand\sconvince\syourself\sthat\sthe\sprocedure\snames\sare\n\nquite\slegitimate\sand\swork\sjust\sfine:\n\n\nprotclsh82\n\n%\ssource\s/tmp/test.tcl\n\n%\s{ugly*\s$procname\s[error\sGOTCHA!]}\sthis\swill\sbe\sechoed\n\nthis\swill\sbe\sechoed\n\n%\s{ugly*\\*\\\\*\s\\$\\\\$\\\\\\$procname\s[\\[\\\\[error\sGOTCHA!]]]}\sthis\swill\sbe\sechoed\n\nthis\swill\sbe\sechoed\n\n\nMake\sthe\sindex:\n\n\n%\sauto_mkindex\s/tmp\s/tmp/test.tcl\n\n\nInvoke\sprotclsh\sagain,\sand\sadd\s/tmp\sto\sauto_path,\sthen\stry\sto\sexecute\n\nthe\sabove\sperfectly\slegitimate\scommands:\n\n\nprotclsh82\n\n%\slappend\sauto_path\s/tmp;\\\n\n\s\s{ugly*\s$procname\s[error\sGOTCHA!]}\sthis\swill\sbe\sechoed\n\nerror\swhile\sautoloading\s"ugly*\s$procname\s[error\sGOTCHA!]":\sGOTCHA!\n\n\nObservedBehavior:\n\nWith\sa\sbit\sof\stinkering,\sassorted\sother\seffects\sare\spossible:\scomplaints\n\nabout\sundefined\svariables,\smismatched\sbrackets,\sand\sjust\splain\sreturn\sto\n\nUnix\sshell\sif\sa\sprocedure\sname\sis\s{[exit]}.\n\n\nDesiredBehavior:\n\nNone\sof\sthe\sabove.\n\n\nPatch:\n\n***\sold/auto.tcl\s\s\s\s\s\s\s\sThu\sJul\s29\s15:46:09\s1999\n\n---\s./auto.tcl\s\sThu\sJul\s29\s16:34:54\s1999\n\n***************\n\n***\s463,472\s****\n\n\s\s\s\s\s\s}\n\n\n\s\s\s\s\s\sif\s{[namespace\squalifiers\s$name]\s==\s""}\s{\n\n!\s\s\s\s\s\s\s\s\sreturn\s[namespace\stail\s$name]\n\n\s\s\s\s\s\s}\selseif\s{![string\smatch\s::*\s$name]}\s{\n\n!\s\s\s\s\s\s\s\s\sreturn\s"::$name"\n\n\s\s\s\s\s\s}\n\n\s\s\s\s\s\sreturn\s$name\n\n\s\s}\n\n\n---\s463,477\s----\n\n\s\s\s\s\s\s}\n\n\n\s\s\s\s\s\sif\s{[namespace\squalifiers\s$name]\s==\s""}\s{\n\n!\s\s\s\s\s\s\s\s\sset\sname\s[namespace\stail\s$name]\n\n\s\s\s\s\s\s}\selseif\s{![string\smatch\s::*\s$name]}\s{\n\n!\s\s\s\s\s\s\s\s\sset\sname\s"::$name"\n\n\s\s\s\s\s\s}\n\n+\s\n\n+\s\s\s\s\s#\sSince\sauto_mkindex_parser::mkindex\shas\sescaped\sall\s$\scharacters,\swe\n\n+\s\s\s\s\s#\sshould\srestore\sthe\scorrect\sprocedure\snames:\n\n+\s\s\s\s\sregsub\s-all\s--\s{\\\\\\$}\s$name\s{$}\sname\n\n+\s\n\n\s\s\s\s\s\sreturn\s$name\n\n\s\s}\n\n***************\n\n***\s311,318\s****\n\n---\s311,324\s----\n\n\s\s\s\s\s\sforeach\sname\s$nameList\s{\n\n\s\s\s\s\s\s\s\sif\s{[info\sexists\sauto_index($name)]}\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\suplevel\s#0\s$auto_index($name)\n\n+\s\s\s\s\s\s\s\s\s\s\s#\sCommand\snames\smay\scontain\sweird\scharacters\s(e.g.\s[])\sthat\smay\n\n+\s\s\s\s\s\s\s\s\s\s\s#\sprevent\sa\ssuccessful\smatch,\sso\suse\sa\strick\sand\sif\s'info\scommand'\n\n+\s\s\s\s\s\s\s\s\s\s\s#\sfails,\squery\sthe\scurrent\snamespace\sfor\sthe\sorigin\sof\sthe\scommand.\n\n+\s\s\s\s\s\s\s\s\s\s\s#\n\n\s\s\s\s\s\s\s\s\s\s\s\sif\s{[info\scommands\s$name]\s!=\s""}\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sreturn\s1\n\n+\s\s\s\s\s\s\s\s\s\s\s}\selseif\s{[namespace\swhich\s-command\s$name]\s!=\s""}\s{\n\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sreturn\s1\n\n\s\s\s\s\s\s\s\s\s\s\s\s}\n\n\s\s\s\s\s\s\s\s}\n\n\s\s\s\s\s\s}\n\n***************\n\n***\s353,359\s****\n\n\s\s\s\s\s\s\s\s\s\s\s\sset\serror\s[catch\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sset\sid\s[gets\s$f]\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sif\s{$id\s==\s"#\sTcl\sautoload\sindex\sfile,\sversion\s2.0"}\s{\n\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\seval\s[read\s$f]\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\selseif\s{$id\s==\s\\\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s"#\sTcl\sautoload\sindex\sfile:\seach\sline\sidentifies\sa\sTcl"}\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\swhile\s{[gets\s$f\sline]\s>=\s0}\s{\n\n---\s359,367\s----\n\n\s\s\s\s\s\s\s\s\s\s\s\sset\serror\s[catch\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sset\sid\s[gets\s$f]\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sif\s{$id\s==\s"#\sTcl\sautoload\sindex\sfile,\sversion\s2.0"}\s{\n\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s#\seval\s[read\s$f]\sfails\sin\svarious\sinteresting\sways,\sbut\n\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s#\ssourcing\sthe\sfile\sdirectly\sseems\sto\swork\sjust\sfine.\n\n!\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\ssource\s[file\sjoin\s$dir\stclIndex]\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\selseif\s{$id\s==\s\\\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s"#\sTcl\sautoload\sindex\sfile:\seach\sline\sidentifies\sa\sTcl"}\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\swhile\s{[gets\s$f\sline]\s>=\s0}\s{\n\n\nPatchFiles:\n\nauto.tcl\sand\sinit.tcl\n\n\n\n\nI\sam\sunable\sto\sreproduce\sthis\sbug\sin\s8.3b2\s(although\sI\scould\sin\s8.2.1).\s\sThere\shave\sbeen\sseveral\schanges\sto\sthe\sauto.tcl\sand\sinit.tcl\sfiles\sin\sthat\stime,\sas\swell\sas\smany\schanges\sto\sthe\score\sitself,\sso\sI'm\snot\scertain\swhen\sspecifically\sthis\sbug\swas\sfixed.\n\nHowever,\sinvestigating\sthis\sbug\sdid\sexpose\sa\snew\sbug\sin\sthe\sauto\sloader,\srelating\sto\sthe\suse\sof\s*\sand\s[]\sin\sthe\sproc\sname.\s\sBecause\sof\sthe\smatching\stechnique\sused\sto\sdetermine\sif\sthe\scommand\shad\sbeen\ssuccessfully\sloaded,\sthose\scharacters\swere\sbeing\sinterpreted\sas\sglob-style\sspecifiers,\swhich\swas\scausing\sthe\sauto\sloader\sto\sthink\sthat\sthe\scommand\shad\snot\sbeen\sloaded\swhen\sit\sactually\shad\sbeen.\s\sI\sfixed\sthis\sbug\sfor\s8.3.\n\n-\seric\n\n--\s01/28/2000\sericm\n\nOn\sfurther\sconsideration,\sit\sseems\sthat\sI\smisspoke.\s\sThe\serror\sdoes\sexist,\salbeit\sin\sa\sslightly\saltered\sform.\s\sIf\syou\shave\scode\ssuch\sas:\nproc\s{\\\\$foobar}\s{}\s{}\n\nYou\swill\ssee\sthis\sproblem.\s\sRealistically,\showever,\speople\sare\snot\sgoing\sto\smake\sprocedure\snames\slike\sthis,\sand\sthe\sauto\sindexing\sprocedures\swere\snot\sdesigned\sto\shandle\sthis\ssort\sof\scase.\s\sIf\syou\sneed\sto\sindex\sa\sfile\swith\sprocedure\snames\slike\sthat,\sperhaps\syou\scould\suse\sauto_mkindex_old,\swhich\suses\sa\sless\ssophisticated\sbut\sin\ssome\scases\s(like\sthis\sone)\smore\srobust\salgorithm.\n\n-\seric\n\n--\s01/28/2000\sericm\n\n
J foundin obsolete:\s8.2b1
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 56.\sLibTomMath
J title FIX\sfor\sauto_mkindex/auto_load\sbugs\son\sfunny\sprocedure\snames
J type Bug
K 218871ffffffffffffffffffffffffffffffffff
U nobody
Z 29be9426668d7155aaaf7b7b886dba55