michael@0: #!/bin/sh michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # michael@0: # The purpose of this file is to find the files that do not end with a michael@0: # newline. Some compilers fail if the source files do not end with a michael@0: # newline. michael@0: # michael@0: michael@0: # michael@0: test_file=newline_test michael@0: test_dummy=newline_testee michael@0: inlist="$*" michael@0: broken_list= michael@0: michael@0: if test "$inlist" = ""; then michael@0: echo "Usage: $0 *.c *.cpp"; michael@0: exit 0; michael@0: fi michael@0: michael@0: echo "" > $test_file michael@0: michael@0: for f in $inlist; do michael@0: if test -f $f; then michael@0: tail -c 1 $f > $test_dummy michael@0: if ! `cmp -s $test_file $test_dummy`; then michael@0: broken_list="$broken_list $f" michael@0: fi michael@0: fi michael@0: done michael@0: michael@0: rm -f $test_file $test_dummy michael@0: echo $broken_list