aboutsummaryrefslogtreecommitdiff
path: root/tclcompat.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tclcompat.tcl')
-rw-r--r--tclcompat.tcl16
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 ""