Skip to content

Commit

Permalink
podlators: load PerlIO before trying to use its functions
Browse files Browse the repository at this point in the history
Cherry-picked from rra/podlators#28

Since it's a cherry-pick, podlators was marked as CUSTOMIZED and its
version was bumped.

Fixes #21841
  • Loading branch information
xenu authored and haarg committed Apr 25, 2024
1 parent 404e97f commit 7a2df06
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 7 deletions.
10 changes: 9 additions & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,15 @@ package Maintainers;
qr{^\.github/dependabot\.yml},
qr{^\.github/workflows/build\.yaml},
],

'CUSTOMIZED' => [
# https://github.com/rra/podlators/pull/28
'lib/Pod/Man.pm',
'lib/Pod/ParseLink.pm',
'lib/Pod/Text.pm',
'lib/Pod/Text/Color.pm',
'lib/Pod/Text/Overstrike.pm',
'lib/Pod/Text/Termcap.pm'
],
'MAP' => {
'' => 'cpan/podlators/',
# this file lives outside the cpan/ directory
Expand Down
3 changes: 2 additions & 1 deletion cpan/podlators/lib/Pod/Man.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ BEGIN {
}

our @ISA = qw(Pod::Simple);
our $VERSION = '5.01';
our $VERSION = '5.01_01';

# Ensure that $Pod::Simple::nbsp and $Pod::Simple::shy are available. Code
# taken from Pod::Simple 3.32, but was only added in 3.30.
Expand Down Expand Up @@ -865,6 +865,7 @@ sub start_document {
if ($$self{ENCODING}) {
$$self{ENCODE} = 1;
eval {
require PerlIO;
my @options = (output => 1, details => 1);
my @layers = PerlIO::get_layers (*{$$self{output_fh}}, @options);
if ($layers[-1] && ($layers[-1] & PerlIO::F_UTF8 ())) {
Expand Down
2 changes: 1 addition & 1 deletion cpan/podlators/lib/Pod/ParseLink.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use Exporter;

our @ISA = qw(Exporter);
our @EXPORT = qw(parselink);
our $VERSION = '5.01';
our $VERSION = '5.01_01';

##############################################################################
# Implementation
Expand Down
3 changes: 2 additions & 1 deletion cpan/podlators/lib/Pod/Text.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Exporter ();
use Pod::Simple ();

our @ISA = qw(Pod::Simple Exporter);
our $VERSION = '5.01';
our $VERSION = '5.01_01';

# We have to export pod2text for backward compatibility.
our @EXPORT = qw(pod2text);
Expand Down Expand Up @@ -363,6 +363,7 @@ sub start_document {
# disable encoding.
$$self{ENCODE} = 1;
eval {
require PerlIO;
my @options = (output => 1, details => 1);
my $flag = (PerlIO::get_layers ($$self{output_fh}, @options))[-1];
if ($flag && ($flag & PerlIO::F_UTF8 ())) {
Expand Down
2 changes: 1 addition & 1 deletion cpan/podlators/lib/Pod/Text/Color.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use Pod::Text ();
use Term::ANSIColor qw(color colored);

our @ISA = qw(Pod::Text);
our $VERSION = '5.01';
our $VERSION = '5.01_01';

##############################################################################
# Overrides
Expand Down
2 changes: 1 addition & 1 deletion cpan/podlators/lib/Pod/Text/Overstrike.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use warnings;
use Pod::Text ();

our @ISA = qw(Pod::Text);
our $VERSION = '5.01';
our $VERSION = '5.01_01';

##############################################################################
# Overrides
Expand Down
2 changes: 1 addition & 1 deletion cpan/podlators/lib/Pod/Text/Termcap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use POSIX ();
use Term::Cap;

our @ISA = qw(Pod::Text);
our $VERSION = '5.01';
our $VERSION = '5.01_01';

##############################################################################
# Overrides
Expand Down
6 changes: 6 additions & 0 deletions t/porting/customized.dat
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ Time::Piece cpan/Time-Piece/Piece.pm 8cec8b66183ceddb9bf2b6af35dcdd345bc9adfa
Time::Piece cpan/Time-Piece/Piece.xs 543152540ee17788a638b2c5746b86c3d04401d1
Win32API::File cpan/Win32API-File/File.pm 8fd212857f821cb26648878b96e57f13bf21b99e
Win32API::File cpan/Win32API-File/File.xs beb870fed4490d2faa547b4a8576b8d64d1d27c5
podlators cpan/podlators/lib/Pod/Man.pm 69b80c16ed960c222ab6726cde177cf2949d366d
podlators cpan/podlators/lib/Pod/ParseLink.pm e84ac4d8121c7ed733a23f5ead5c2481f34dafa3
podlators cpan/podlators/lib/Pod/Text.pm 367a5ec329148637c83ddcf072f929ba1e9eb953
podlators cpan/podlators/lib/Pod/Text/Color.pm f1401820e6799270bdd1b4513be9c849521fb533
podlators cpan/podlators/lib/Pod/Text/Overstrike.pm 9def24cfb97743ac6d935fd84a86ae560e70c9ca
podlators cpan/podlators/lib/Pod/Text/Termcap.pm b86e1cf3a01cc6084436ae61b2e97fcffe064817
version cpan/version/lib/version.pm 8080cfe1fb21d5248c8ff5133b298d249d11e8e8

0 comments on commit 7a2df06

Please sign in to comment.