ports/textproc/p5-Pod-Perldoc/files/patch-lib_Pod_Perldoc_ToMan.pm
Mathieu Arnold fdfb149bb4 Explain perldoc how to handle MANWIDTH=tty in the environment, and stop
it from reporting tty being an invalid version.

With hat:	perl@
Sponsored by:	Absolight
2017-04-04 14:06:51 +00:00

20 lines
668 B
Perl

--- lib/Pod/Perldoc/ToMan.pm.orig 2015-02-12 03:08:10 UTC
+++ lib/Pod/Perldoc/ToMan.pm
@@ -63,7 +63,7 @@ sub init {
sub _roffer_candidates {
my( $self ) = @_;
- if( $self->is_openbsd || $self->is_bitrig ) { qw( mandoc groff nroff ) }
+ if( $self->is_openbsd || $self->is_freebsd || $self->is_bitrig ) { qw( mandoc groff nroff ) }
else { qw( groff nroff mandoc ) }
}
@@ -108,6 +108,8 @@ sub _get_columns_from_manwidth {
return 0 unless defined $ENV{MANWIDTH};
+ if ($ENV{MANWIDTH} eq 'tty') { return 0; }
+
unless( $ENV{MANWIDTH} =~ m/\A\d+\z/ ) {
$self->warn( "Ignoring non-numeric MANWIDTH ($ENV{MANWIDTH})\n" );
return 0;