Skip to content

Commit

Permalink
porting/customized.t, pod_rules.t: treat crlf as lf when checking files
Browse files Browse the repository at this point in the history
Doing a default clone of perl on Win32 checks files out with CRLF
line separators, which made the customized file digests mismatch
those in customized.dat, and parsing fail for pod_rules.t

Ignore CRLF on Win32 when creating the digests and when reading in
files for parsing.
  • Loading branch information
tonycoz committed Jul 18, 2023
1 parent cc54951 commit 917da81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Porting/pod_lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ sub slurp_or_die {
my $filename = shift;
my $fh = open_or_die($filename);
binmode $fh;
binmode $fh, ":crlf" if $^O eq "MSWin32";
local $/;
my $contents = <$fh>;
die "Can't read $filename: $!" unless defined $contents and close $fh;
Expand Down
1 change: 1 addition & 0 deletions t/porting/customized.t
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ foreach my $module ( sort keys %Modules ) {
{
open my $fh, '<', $file or die "Can't open $file";
binmode $fh;
binmode $fh, ":crlf" if $^O eq "MSWin32";
$digest->addfile( $fh );
close $fh;
}
Expand Down

0 comments on commit 917da81

Please sign in to comment.