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, 10 insertions, 8 deletions
diff --git a/tools/eolFix.tcl b/tools/eolFix.tcl
index ed3ec7c..3f35ed4 100644
--- a/tools/eolFix.tcl
+++ b/tools/eolFix.tcl
@@ -13,16 +13,18 @@ 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 != ""} {
+ if {$newfilename ne ""} {
set newfhnd [open ${newfilename} w]
} else {
set newfhnd [open ${filename} w]
@@ -63,12 +65,12 @@ proc EOL::fixall {args} {
}
if {$tcl_interactive == 0 && $argc > 0} {
- if {[string index [lindex $argv 0] 0] == "-"} {
+ if {[string index [lindex $argv 0] 0] eq "-"} {
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]
}