Author: radek                        Date: Sat Jun 11 07:11:59 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- check ref() *before* reading!

---- Files affected:
SOURCES:
   perl-Pod-Parser-broken.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/perl-Pod-Parser-broken.patch
diff -u /dev/null SOURCES/perl-Pod-Parser-broken.patch:1.1
--- /dev/null   Sat Jun 11 09:11:59 2005
+++ SOURCES/perl-Pod-Parser-broken.patch        Sat Jun 11 09:11:54 2005
@@ -0,0 +1,76 @@
+diff -urN Pod-Parser-1.30/lib/Pod/Parser.pm PodParser-1.29/lib/Pod/Parser.pm
+--- Pod-Parser-1.30/lib/Pod/Parser.pm  2005-03-12 18:47:23.000000000 +0100
++++ PodParser-1.29/lib/Pod/Parser.pm   2005-02-08 23:52:36.000000000 +0100
+@@ -1163,14 +1163,7 @@
+     local *_;
+ 
+     ## Is $infile a filename or a (possibly implied) filehandle
+-    $infile  = '-'  unless ((defined $infile) && (length $infile));
+-    if (($infile  eq '-') || ($infile =~ /^<&(STDIN|0)$/i)) {
+-        ## Not a filename, just a string implying STDIN
+-        $infile ||= '-';
+-        $myData{_INFILE} = "<standard input>";
+-        $in_fh = \*STDIN;
+-    }
+-    elsif (ref $infile) {
++    if (ref $infile) {
+         if (ref($infile) =~ /^(SCALAR|ARRAY|HASH|CODE|REF)$/) {
+             croak "Input from $1 reference not supported!\n";
+         }
+@@ -1179,6 +1172,14 @@
+         $myData{_INFILE} = ${$infile};
+         $in_fh = $infile;
+     }
++    elsif (!defined($infile) || !length($infile) || ($infile eq '-')
++        || ($infile =~ /^<&(?:STDIN|0)$/i))
++    {
++        ## Not a filename, just a string implying STDIN
++        $infile ||= '-';
++        $myData{_INFILE} = "<standard input>";
++        $in_fh = \*STDIN;
++    }
+     else {
+         ## We have a filename, open it for reading
+         $myData{_INFILE} = $infile;
+@@ -1194,20 +1195,7 @@
+     ## already
+ 
+     ## Is $outfile a filename, a (possibly implied) filehandle, maybe a ref?
+-    if (!defined($outfile) || !length($outfile) || ($outfile eq '-')
+-        || ($outfile =~ /^>&?(?:STDOUT|1)$/i))
+-    {
+-        if (defined $myData{_TOP_STREAM}) {
+-            $out_fh = $myData{_OUTPUT};
+-        }
+-        else {
+-            ## Not a filename, just a string implying STDOUT
+-            $outfile ||= '-';
+-            $myData{_OUTFILE} = "<standard output>";
+-            $out_fh  = \*STDOUT;
+-        }
+-    }
+-    elsif (ref $outfile) {
++    if (ref $outfile) {
+         ## we need to check for ref() first, as other checks involve reading
+         if (ref($outfile) =~ /^(ARRAY|HASH|CODE)$/) {
+             croak "Output to $1 reference not supported!\n";
+@@ -1227,6 +1215,19 @@
+             $out_fh = $outfile;
+         }
+     }
++    elsif (!defined($outfile) || !length($outfile) || ($outfile eq '-')
++        || ($outfile =~ /^>&?(?:STDOUT|1)$/i))
++    {
++        if (defined $myData{_TOP_STREAM}) {
++            $out_fh = $myData{_OUTPUT};
++        }
++        else {
++            ## Not a filename, just a string implying STDOUT
++            $outfile ||= '-';
++            $myData{_OUTFILE} = "<standard output>";
++            $out_fh  = \*STDOUT;
++        }
++    }
+     elsif ($outfile =~ /^>&(STDERR|2)$/i) {
+         ## Not a filename, just a string implying STDERR
+         $myData{_OUTFILE} = "<standard error>";
================================================================
_______________________________________________
pld-cvs-commit mailing list
[EMAIL PROTECTED]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to