From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Frank Ch. Eigler" To: sid@sources.redhat.com, insight@sources.redhat.com Subject: gdb/generic/tclInitScript.h patch Date: Tue, 17 Jul 2001 10:22:00 -0000 Message-id: <20010717132232.F31701@redhat.com> X-SW-Source: 2001-q3/msg00020.html Hi - I'm planning to commit this obvious patch to tcl/generic/tclInitScript.h. The block of code being modified was recently added, and broke build-tree testing of sid. It did this by not properly guarding some [file] operations against errors that are innocent and shouldn't make Tcl_Init abort. Thanks to bje for reporting this problem. 2001-07-17 Frank Ch. Eigler * generic/tclInitScript.h (initScript): Check that nameofexecutable is valid (file exists) before traversing it as a possible link. Index: generic/tclInitScript.h =================================================================== RCS file: /cvs/src/src/tcl/generic/tclInitScript.h,v retrieving revision 1.3 diff -u -1 -0 -r1.3 tclInitScript.h --- tclInitScript.h 2000/06/05 23:07:29 1.3 +++ tclInitScript.h 2001/07/17 17:22:03 @@ -77,21 +77,21 @@ lappend dirs $env(TCL_LIBRARY)\n\ }\n\ # CYGNUS LOCAL: I've changed this alot. \n\ # Basically we only care about two cases,\n\ # if we are installed, and if we are in the devo tree...\n\ # The next few are for if we are installed:\n\ # NB. We also want this to work if the user is actually\n\ # running a link and not the actual program. So look for a\n\ # link and chase it down to its source.\n\ set execName [info nameofexecutable]\n\ - if {[string compare [file type $execName] \"link\"] == 0} {\n\ + if {[file exists $execName] && [string compare [file type $execName] \"link\"] == 0} {\n\ set execName [file readlink $execName]\n\ if {[string compare [file pathtype $execName] \"relative\"] == 0} {\n\ set execName [file join [pwd] $execName]\n\ }\n\ }\n\ set parentDir [file dirname [file dirname $execName]]\n\ lappend dirs [file join $parentDir share tcl$tcl_version]\n\ lappend dirs [file join $parentDir \"usr\" share tcl$tcl_version]\n\ lappend dirs [file join [file dirname $parentDir] share tcl$tcl_version]\n\ # NOW, let's try to find it in the build tree...\n\ -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7VHRYVZbdDOm/ZT0RAmNpAJ9h4Hj7hg6cpCqnDaAN5++oHt+rQwCfTtm5 dnqHtRLF/dv5noIcp8nNgX4= =IahV -----END PGP SIGNATURE-----