summaryrefslogtreecommitdiffstats
path: root/tools/eolFix.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eolFix.tcl')
-rw-r--r--tools/eolFix.tcl18
1 files changed, 8 insertions, 10 deletions
diff --git a/tools/eolFix.tcl b/tools/eolFix.tcl
index 3f35ed4..ed3ec7c 100644
--- a/tools/eolFix.tcl
+++ b/tools/eolFix.tcl
@@ -13,18 +13,16 @@ namespace eval ::EOL {
variable outMode crlf
}
-proc EOL::fix {filename {newfilename {}}} {
+proc EOL::fix {filename {newfilename ""}} {
variable outMode
- if {![file exists $filename]} {
- return
- }
+ if {![file exists $filename]} { return }
puts "EOL Fixing: $filename"
file rename ${filename} ${filename}.o
set fhnd [open ${filename}.o r]
- if {$newfilename ne ""} {
+ if {$newfilename != ""} {
set newfhnd [open ${newfilename} w]
} else {
set newfhnd [open ${filename} w]
@@ -65,12 +63,12 @@ proc EOL::fixall {args} {
}
if {$tcl_interactive == 0 && $argc > 0} {
- if {[string index [lindex $argv 0] 0] eq "-"} {
+ if {[string index [lindex $argv 0] 0] == "-"} {
switch -- [lindex $argv 0] {
- -cr {set ::EOL::outMode cr}
- -crlf {set ::EOL::outMode crlf}
- -lf {set ::EOL::outMode lf}
- default {puts stderr "improper mode switch"; exit 1}
+ -cr { set ::EOL::outMode cr }
+ -crlf { set ::EOL::outMode crlf }
+ -lf { set ::EOL::outMode lf }
+ default { puts stderr "improper mode switch" ; exit 1 }
}
set argv [lrange $argv 1 end]
}