3 # checkCtrlM checks source code for explicit ctrl-M's
4 # checks only files with the following extensions: .c, .cxx, .txx, .html, .htm
5 # exits with 0, if all commited files pass the test.
6 # exits with 1, if any one of the tests fails
8 # checkCtrlM can be run as a cvs commitinfo command.
9 # The following commitinfo line (without the #) will run the script
10 # ALL $CVSROOT/CVSROOT/checkCtrlM
14 # skip the first arg, the directory
19 # select files with extentions .txx, .cxx, .h, .html, .htm, .c, .txt, .cmake
20 match=`echo $file | egrep \[\.\]txx\$\|\[\.\]cxx\$\|\[\.\]h\$\|\[\.\]html\$\|\[\.\]htm\$\|\[\.\]c\$\|\[\.\]txt\$\|\[\.\]cmake\$`
21 if [ "x$match" != "x" ] ; then
23 \$ /dev/null $file|wc -c`
24 results=`expr $count \| 0`
25 if [ "$results" != "0" ]; then
26 echo "=========================================================="
27 if [ $results -lt 200 ]; then
32 echo "$file has ^M's. They must be removed before you can commit."
33 echo "The problem count was $results"
34 echo "=========================================================="