Index: openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl 25 Jul 2018 16:15:31 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl 27 Jul 2018 10:03:23 -0000 1.21 @@ -360,9 +360,11 @@ incr count set whitespace_count 0 set line_number 0 - #ns_log Notice "Looking for trailing whitespace in file $file" + + # Check for trailing whitespace in every line while {[gets $f line] >= 0} { incr line_number + set last_line $line if {[regexp {[ \t]+$} $line]} { # Found trailing whitespace! incr whitespace_count @@ -371,6 +373,12 @@ } close $f + # Check for empty lines at the end of the file + if {[regexp {^\s*$} $last_line]} { + incr whitespace_count + lappend line_numbers "end of file" + } + # Check results on $file if { $whitespace_count == 0 } { incr good