From: Jeff Hobbs Date: Wed, 14 Nov 2001 22:18:12 +0000 (+0000) Subject: added catch around file type call X-Git-Tag: tkcon-2-4~38 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=6e3c689579ef8b6af90e5b24cdc8598ec67505cc;p=tkcon added catch around file type call --- diff --git a/ChangeLog b/ChangeLog index 789f608..da62ff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-11-14 Jeff Hobbs + + * tkcon.tcl: added catch around file type call + 2001-10-14 Jeff Hobbs * tkcon.tcl (Init): corrected loading of rcfile when it was in a diff --git a/tkcon.tcl b/tkcon.tcl index c719c61..dd3ba36 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -5189,17 +5189,22 @@ proc ::tkcon::Retrieve {} { ## set ::tkcon::PRIV(SCRIPT) [info script] if {!$::tkcon::PRIV(WWW) && [string compare $::tkcon::PRIV(SCRIPT) {}]} { - while {[string match link [file type $::tkcon::PRIV(SCRIPT)]]} { - set link [file readlink $::tkcon::PRIV(SCRIPT)] - if {[string match relative [file pathtype $link]]} { - set ::tkcon::PRIV(SCRIPT) [file join [file dirname $::tkcon::PRIV(SCRIPT)] $link] - } else { - set ::tkcon::PRIV(SCRIPT) $link + # we use a catch here because some wrap apps choke on 'file type' + # because TclpLstat wasn't wrappable until 8.4. + catch { + while {[string match link [file type $::tkcon::PRIV(SCRIPT)]]} { + set link [file readlink $::tkcon::PRIV(SCRIPT)] + if {[string match relative [file pathtype $link]]} { + set ::tkcon::PRIV(SCRIPT) \ + [file join [file dirname $::tkcon::PRIV(SCRIPT)] $link] + } else { + set ::tkcon::PRIV(SCRIPT) $link + } + } + catch {unset link} + if {[string match relative [file pathtype $::tkcon::PRIV(SCRIPT)]]} { + set ::tkcon::PRIV(SCRIPT) [file join [pwd] $::tkcon::PRIV(SCRIPT)] } - } - catch {unset link} - if {[string match relative [file pathtype $::tkcon::PRIV(SCRIPT)]]} { - set ::tkcon::PRIV(SCRIPT) [file join [pwd] $::tkcon::PRIV(SCRIPT)] } }