diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 13:46:32 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:45 +1000 |
commit | ee6dbe0a8d66f8f17a5da82e8dad810d88e33bf6 (patch) | |
tree | 994b59d11b3199f697adaea8303ae8b5dc438397 /tclcompat.tcl | |
parent | 541fe7c30691ace08847a35280d9cc8bc02e9a72 (diff) | |
download | jimtcl-ee6dbe0a8d66f8f17a5da82e8dad810d88e33bf6.zip jimtcl-ee6dbe0a8d66f8f17a5da82e8dad810d88e33bf6.tar.gz jimtcl-ee6dbe0a8d66f8f17a5da82e8dad810d88e33bf6.tar.bz2 |
Allow catch to specify what is caught
*: Default to the same as Tcl. Not signal, eval, exit.
*: Use 'catch -exit' to also catch exit.
*: Also map for standard return codes: [info returncodes]
*: Also Jim_ReturnCode()
*: Add Jim_FindByName() for searching in a char* array
*: Fix 'info nameofexectutable' if $::jim_argv0 is not set
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 "" |