aboutsummaryrefslogtreecommitdiffstats
path: root/fix-eol
diff options
context:
space:
mode:
Diffstat (limited to 'fix-eol')
-rwxr-xr-xfix-eol7
1 files changed, 4 insertions, 3 deletions
diff --git a/fix-eol b/fix-eol
index 3914afc..1480e0f 100755
--- a/fix-eol
+++ b/fix-eol
@@ -12,11 +12,12 @@ die "Invalid build root" unless -d $buildroot;
# normalize build root
$buildroot =~ s|/$||;
-my %exclude_files = (
- map { $buildroot . $_ => 1 }
+my $exclude_pattern = join('|',
+ map { '(:?' . quotemeta($_) . ')' }
$ENV{EXCLUDE_FROM_EOL_CONVERSION} ?
split(' ', $ENV{EXCLUDE_FROM_EOL_CONVERSION}) : ()
);
+$exclude_pattern = qr/$exclude_pattern/;
find(\&convert, $buildroot);
@@ -26,7 +27,7 @@ sub convert {
# reject binary files
return unless -T $_;
# reject excluded files
- return if $exclude_files{$File::Find::name};
+ return if $File::Find::name =~ $exclude_pattern;
# check if first line has less than 80 characters and ends with \r\n
open(my $in, '<', $_) or die "Unable to open file $_: $!";