diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2010-09-30 14:27:35 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-09-30 15:09:56 +0200 |
commit | 471b3ba541ecc4e3e91db744443a8f688dbc3ade (patch) | |
tree | 9a535c2f2a4f0f46b36b0c146b217750ac380520 /crawl-ref/source/util/checkwhite | |
parent | e295bb33a8b03105bdb3a864dcaeab9a7ae684f0 (diff) | |
download | crawl-ref-471b3ba541ecc4e3e91db744443a8f688dbc3ade.tar.gz crawl-ref-471b3ba541ecc4e3e91db744443a8f688dbc3ade.zip |
Make checkwhite script windows compatible.
Diffstat (limited to 'crawl-ref/source/util/checkwhite')
-rwxr-xr-x | crawl-ref/source/util/checkwhite | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crawl-ref/source/util/checkwhite b/crawl-ref/source/util/checkwhite index b56cf8b19b..ce6b822817 100755 --- a/crawl-ref/source/util/checkwhite +++ b/crawl-ref/source/util/checkwhite @@ -2,6 +2,8 @@ open FLIST, "git ls-files|" or die "Can't run git ls-files"; +my $nl = ($^O eq 'msys') ? "\r\n" : "\n"; + while(<FLIST>) { chomp; @@ -18,8 +20,8 @@ while(<FLIST>) my $cont=<F>; close F; - print "newline: $_\n" unless $cont =~ /\n$/s; + print "newline at eof: $_\n" unless $cont =~ /$nl$/s; print "tab: $_\n" if $cont =~ /\t/s; - print "spaces at eol: $_\n" if $cont =~ / \n/s; + print "spaces at eol: $_\n" if $cont =~ / $nl/s; } close FLIST; |