summaryrefslogtreecommitdiff
path: root/stdlib.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-07-12 09:01:16 +1000
committerSteve Bennett <steveb@workware.net.au>2011-07-12 19:17:40 +1000
commit652539291e7ff617a9c5480a3445b1afacf6fa8f (patch)
treed591a420d9ebda52aa3a35dafc36d49a38dc20b5 /stdlib.tcl
parent3b317b146c492ca5176044484af7d5877799a716 (diff)
Return an absolute path for [info nameofexec]
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'stdlib.tcl')
-rw-r--r--stdlib.tcl8
1 files changed, 4 insertions, 4 deletions
diff --git a/stdlib.tcl b/stdlib.tcl
index 84e9120..3abeb3e 100644
--- a/stdlib.tcl
+++ b/stdlib.tcl
@@ -101,11 +101,11 @@ proc errorInfo {msg {stacktrace ""}} {
# Returns the empty string if not found.
proc {info nameofexecutable} {} {
if {[info exists ::jim_argv0]} {
- if {[string first "/" $::jim_argv0] >= 0} {
- return $::jim_argv0
+ if {[string match "*/*" $::jim_argv0]} {
+ return [file join [pwd] $::jim_argv0]
}
- foreach path [split [env PATH ""] :] {
- set exec [file join $path $::jim_argv0]
+ foreach path [split [env PATH ""] $::tcl_platform(pathSeparator)] {
+ set exec [file join [pwd] $path $::jim_argv0]
if {[file executable $exec]} {
return $exec
}