292b33
From 915ceb2f33469eeffd28cfb81ca52a05e1301f15 Mon Sep 17 00:00:00 2001
292b33
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
292b33
Date: Fri, 14 Sep 2012 13:17:29 +0200
292b33
Subject: [PATCH] Override the Pod::Simple::parse_file
292b33
292b33
This sets output_fh to STDOUT if it's not already set.
292b33
This resolves CPANRT#77530 and RHBZ#826872 and is fixed in podlators-2.4.1.
292b33
Ported to perl-5.14.2.
292b33
---
292b33
 cpan/podlators/lib/Pod/Man.pm  | 11 +++++++++++
292b33
 cpan/podlators/lib/Pod/Text.pm | 11 +++++++++++
292b33
 2 files changed, 22 insertions(+)
292b33
292b33
diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
292b33
index 96f3fcc..ad5e5ac 100644
292b33
--- a/cpan/podlators/lib/Pod/Man.pm
292b33
+++ b/cpan/podlators/lib/Pod/Man.pm
292b33
@@ -1302,6 +1302,17 @@ sub parse_from_filehandle {
292b33
     $self->parse_from_file (@_);
292b33
 }
292b33
 
292b33
+# Pod::Simple's parse_file doesn't set output_fh.  Wrap the call and do so
292b33
+# ourself unless it was already set by the caller, since our documentation has
292b33
+# always said that this should work.
292b33
+sub parse_file {
292b33
+    my ($self, $in) = @_;
292b33
+    unless (defined $$self{output_fh}) {
292b33
+        $self->output_fh (\*STDOUT);
292b33
+    }
292b33
+    return $self->SUPER::parse_file ($in);
292b33
+}
292b33
+
292b33
 ##############################################################################
292b33
 # Translation tables
292b33
 ##############################################################################
292b33
diff --git a/cpan/podlators/lib/Pod/Text.pm b/cpan/podlators/lib/Pod/Text.pm
292b33
index cc02820..1a8b0bf 100644
292b33
--- a/cpan/podlators/lib/Pod/Text.pm
292b33
+++ b/cpan/podlators/lib/Pod/Text.pm
292b33
@@ -679,6 +679,17 @@ sub parse_from_filehandle {
292b33
     $self->parse_from_file (@_);
292b33
 }
292b33
 
292b33
+# Pod::Simple's parse_file doesn't set output_fh.  Wrap the call and do so
292b33
+# ourself unless it was already set by the caller, since our documentation has
292b33
+# always said that this should work.
292b33
+sub parse_file {
292b33
+    my ($self, $in) = @_;
292b33
+    unless (defined $$self{output_fh}) {
292b33
+        $self->output_fh (\*STDOUT);
292b33
+    }
292b33
+    return $self->SUPER::parse_file ($in);
292b33
+}
292b33
+
292b33
 ##############################################################################
292b33
 # Module return value and documentation
292b33
 ##############################################################################
292b33
-- 
292b33
1.7.11.4
292b33