summaryrefslogtreecommitdiffstats
path: root/library/demos/browse
diff options
context:
space:
mode:
Diffstat (limited to 'library/demos/browse')
-rw-r--r--library/demos/browse12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/demos/browse b/library/demos/browse
index d107f28..2e20f9a 100644
--- a/library/demos/browse
+++ b/library/demos/browse
@@ -27,16 +27,16 @@ wm minsize . 1 1
set browseScript [file join [pwd] $argv0]
proc browse {dir file} {
global env browseScript
- if {[string compare $dir "."] != 0} {set file $dir/$file}
- switch [file type $file] {
+ if {$dir ne "."} {set file [file join $dir $file]}
+ switch -- [file type $file] {
directory {
- exec [info nameofexecutable] $browseScript $file &
+ exec -- [info nameofexecutable] $browseScript $file &
}
file {
if {[info exists env(EDITOR)]} {
- eval exec $env(EDITOR) $file &
+ eval exec -- $env(EDITOR) $file &
} else {
- exec xedit $file &
+ exec -- xedit $file &
}
}
default {
@@ -47,7 +47,7 @@ proc browse {dir file} {
# Fill the listbox with a list of all the files in the directory.
-if {$argc>0} {set dir [lindex $argv 0]} else {set dir "."}
+if {$argc > 0} {set dir [lindex $argv 0]} else {set dir "."}
foreach i [lsort [glob * .* *.*]] {
if {[file type $i] eq "directory"} {
# Safe to do since it is still a directory.