aboutsummaryrefslogtreecommitdiff
path: root/contrib/checkSpace.pl
blob: 1589d723c866f5a743042fe50409b356d83d9919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl -w

for $fn (@ARGV) {
    open(F, "$fn");
    $lastnil = 0;
    while (<F>) {
        if (/\r/) {
            print "       CR:$fn:$.\n";
        }
        if (/\t/) {
            print "      TAB:$fn:$.\n";
        }
        if (/ +$/) {
            print "Space\@EOL:$fn:$.\n";
        }
        if ($lastnil && /^$/) {
            print " DoubleNL:$fn:$.\n";
        } elsif (/^$/) {
            $lastnil = 1;
        } else {
            $lastnil = 0;
        }
    }
    close(F);
}