public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: sid@sources.redhat.com, insight@sources.redhat.com
Subject: gdb/generic/tclInitScript.h patch
Date: Tue, 17 Jul 2001 10:22:00 -0000	[thread overview]
Message-ID: <20010717132232.F31701@redhat.com> (raw)

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

                 reply	other threads:[~2001-07-17 10:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010717132232.F31701@redhat.com \
    --to=fche@redhat.com \
    --cc=insight@sources.redhat.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).