| @@ -118,12 +118,12 @@ for file in $FILES; do | |||||
| fi | fi | ||||
| # Check for trailing spaces | # Check for trailing spaces | ||||
| nspaces="$(sed 's/.*[^ \t]//' "$file" | tr -cd '\t ' | wc -c)" | |||||
| nspaces="$(LANG=C sed 's/.*[^ \t]//' "$file" | tr -cd '\t ' | wc -c)" | |||||
| total_spaces="$(($total_spaces + $nspaces))" | total_spaces="$(($total_spaces + $nspaces))" | ||||
| if [ "$nspaces" -gt 0 ]; then | if [ "$nspaces" -gt 0 ]; then | ||||
| clean=false | clean=false | ||||
| if [ "$fix" = true ]; then | if [ "$fix" = true ]; then | ||||
| sed -i 's/[[:space:]][[:space:]]*$//g' "$file" | |||||
| LANG=C sed -i 's/[[:space:]][[:space:]]*$//g' "$file" | |||||
| info "$file has $nspaces trailing spaces" | info "$file has $nspaces trailing spaces" | ||||
| else | else | ||||
| error "$file has $nspaces trailing spaces" | error "$file has $nspaces trailing spaces" | ||||
| @@ -136,7 +136,7 @@ for file in $FILES; do | |||||
| if [ "$ntabs" -gt 0 ]; then | if [ "$ntabs" -gt 0 ]; then | ||||
| clean=false | clean=false | ||||
| if [ "$fix" = true ]; then | if [ "$fix" = true ]; then | ||||
| sed -i 's/\t/ /g' "$file" | |||||
| LANG=C sed -i 's/\t/ /g' "$file" | |||||
| info "$file has $ntabs tabs" | info "$file has $ntabs tabs" | ||||
| else | else | ||||
| error "$file has $ntabs tabs" | error "$file has $ntabs tabs" | ||||
| @@ -172,6 +172,7 @@ EOF | |||||
| if [ "$total_tabs" -gt 0 ]; then | if [ "$total_tabs" -gt 0 ]; then | ||||
| info " - fixed $total_tabs tabs" | info " - fixed $total_tabs tabs" | ||||
| fi | fi | ||||
| info "re-run with -c to commit fixes" | |||||
| else | else | ||||
| # OR: warn about how to fix errors | # OR: warn about how to fix errors | ||||
| info "re-run with -w to fix errors" | info "re-run with -w to fix errors" | ||||