diff options
-rwxr-xr-x | fix_eol | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -13,12 +13,12 @@ die "Invalid build root" unless -d $buildroot; # normalize build root $buildroot =~ s|/$||; -my $exclude_pattern = join('|', +my $exclude_string = join('|', map { '(:?' . quotemeta($_) . ')' } $ENV{EXCLUDE_FROM_EOL_CONVERSION} ? split(' ', $ENV{EXCLUDE_FROM_EOL_CONVERSION}) : () ); -$exclude_pattern = qr/$exclude_pattern/; +my $exclude_pattern = qr/$exclude_string/; find(\&convert, $buildroot); @@ -30,7 +30,7 @@ sub convert { # skip binary files return unless -T $_; # skip excluded files - return if $File::Find::name =~ $exclude_pattern; + return if $exclude_string && $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 $_: $!"; |