diff options
Diffstat (limited to 'tclcompat.tcl')
-rw-r--r-- | tclcompat.tcl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tclcompat.tcl b/tclcompat.tcl index e899278..84876c4 100644 --- a/tclcompat.tcl +++ b/tclcompat.tcl @@ -95,13 +95,15 @@ proc errorInfo {error {stacktrace ""}} { } proc info_nameofexecutable {} { - if {[string first "/" $::jim_argv0] >= 0} { - return $::jim_argv0 - } - foreach path [split [env PATH ""] :] { - set exec [file join $path $::jim_argv0] - if {[file executable $exec]} { - return $exec + if {[info exists ::jim_argv0]} { + if {[string first "/" $::jim_argv0] >= 0} { + return $::jim_argv0 + } + foreach path [split [env PATH ""] :] { + set exec [file join $path $::jim_argv0] + if {[file executable $exec]} { + return $exec + } } } return "" |