Changeset 1909


Ignore:
Timestamp:
Sep 12, 2012, 11:34:44 AM (7 years ago)
Author:
sam
Message:

build: check the source code with LANG=C to avoid locale-related parse
discrepancies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build/check-source.sh

    r1900 r1909  
    119119
    120120          # Check for trailing spaces
    121           nspaces="$(sed 's/.*[^ \t]//' "$file" | tr -cd '\t ' | wc -c)"
     121          nspaces="$(LANG=C sed 's/.*[^ \t]//' "$file" | tr -cd '\t ' | wc -c)"
    122122          total_spaces="$(($total_spaces + $nspaces))"
    123123          if [ "$nspaces" -gt 0 ]; then
    124124              clean=false
    125125              if [ "$fix" = true ]; then
    126                   sed -i 's/[[:space:]][[:space:]]*$//g' "$file"
     126                  LANG=C sed -i 's/[[:space:]][[:space:]]*$//g' "$file"
    127127                  info "$file has $nspaces trailing spaces"
    128128              else
     
    137137              clean=false
    138138              if [ "$fix" = true ]; then
    139                   sed -i 's/\t/    /g' "$file"
     139                  LANG=C sed -i 's/\t/    /g' "$file"
    140140                  info "$file has $ntabs tabs"
    141141              else
     
    173173            info " - fixed $total_tabs tabs"
    174174        fi
     175        info "re-run with -c to commit fixes"
    175176    else
    176177        # OR: warn about how to fix errors
Note: See TracChangeset for help on using the changeset viewer.