This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gdb/generic/tclInitScript.h patch


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  <fche@redhat.com>

	* 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\

PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]