summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/checkwhite
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-01-17 00:33:27 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-01-18 01:44:11 +0100
commit213b1b475fc009db490855b4c4c4a3299744194e (patch)
tree048620a5553c8d6522ff0bf6a2b5f4758c754cca /crawl-ref/source/util/checkwhite
parent716dd2285248751ef3d6d4c4f795fa676ead1bac (diff)
downloadcrawl-ref-213b1b475fc009db490855b4c4c4a3299744194e.tar.gz
crawl-ref-213b1b475fc009db490855b4c4c4a3299744194e.zip
Let checkwhite eradicate BOMs it finds.
Diffstat (limited to 'crawl-ref/source/util/checkwhite')
-rwxr-xr-xcrawl-ref/source/util/checkwhite5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/util/checkwhite b/crawl-ref/source/util/checkwhite
index c3e50ee7d0..d9a0827b75 100755
--- a/crawl-ref/source/util/checkwhite
+++ b/crawl-ref/source/util/checkwhite
@@ -25,8 +25,10 @@ for (@files)
next if m[(^|/)\.git(modules|attributes)$];
next if /\.(lex|tab)\./;
next if !/\./;
- my $tab = /\.(rb|pl|sh)$/i; # Allow tabs for these files.
+ my $tab = /\.(rb|pl|sh)$/; # Allow tabs for these files.
$tab = 1 if /Makefile/i; # ... and for makefiles.
+ my $bom = /\.js$/; # And BOM for these.
+ $bom = 1 if /CREDITS/;
undef local $/;
open F, "<$_" or die "Can't open $_";
my $file = $_;
@@ -49,6 +51,7 @@ for (@files)
# Note: it's a byte string, as we had to handle invalid encodings above,
# and $cont may be invalid.
print "zero width space: $file\n" if s/\xe2\x80\x8b//sg; # U+200B
+ print "BOM: $file\n" if !$bom && s/\xef\xbb\xbf//sg; # U+FFEF
if ($_ ne $cont)
{