Skip to content

Commit

Permalink
Strip BOM before parsing package version
Browse files Browse the repository at this point in the history
  • Loading branch information
charsbar committed Apr 25, 2024
1 parent 0daf9c3 commit fc74707
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/PAUSE/pmfile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,12 @@ sub packages_per_pmfile {
local $/ = "\n";
my $inpod = 0;

my $checked_bom;
PLINE: while (<$fh>) {
chomp;
my($pline) = $_;
$pline =~ s/\A(?:\x00\x00\xfe\xff|\xff\xfe\x00\x00|\xfe\xff|\xff\xfe|\xef\xbb\xbf)// unless $checked_bom;
$checked_bom = 1;
$inpod = $pline =~ /^=(?!cut)/ ? 1 :
$pline =~ /^=cut/ ? 0 : $inpod;
next if $inpod;
Expand Down

0 comments on commit fc74707

Please sign in to comment.