Re: [perl #34493] h2ph `extern inline' problems
[p5sagit/p5-mst-13.2.git] / autodoc.pl
index c87f114..6126f9f 100644 (file)
@@ -33,6 +33,7 @@ sub walk_table (&@) {
     else {
        safer_unlink $filename;
        open F, ">$filename" or die "Can't open $filename: $!";
+       binmode F;
        $F = \*F;
     }
     print $F $leader if $leader;
@@ -44,6 +45,7 @@ sub walk_table (&@) {
            $_ .= <IN>;
            chomp;
        }
+       s/\s+$//;
        my @args;
        if (/^\s*(#|$)/) {
            @args = $_;
@@ -158,6 +160,7 @@ for $file (($MANIFEST =~ /^(\S+\.c)\t/gm), ($MANIFEST =~ /^(\S+\.h)\t/gm)) {
 safer_unlink "pod/perlapi.pod";
 open (DOC, ">pod/perlapi.pod") or
        die "Can't create pod/perlapi.pod: $!\n";
+binmode DOC;
 
 walk_table {   # load documented functions into approriate hash
     if (@_ > 1) {
@@ -217,7 +220,8 @@ my $key;
 for $key (sort { uc($a) cmp uc($b) || $a cmp $b } keys %apidocs) {
     my $section = $apidocs{$key}; 
     print DOC "\n=head1 $key\n\n=over 8\n\n";
-    for my $key (sort { uc($a) cmp uc($b); } keys %$section) {
+    # Again, fallback for determinacy
+    for my $key (sort { uc($a) cmp uc($b) || $a cmp $b } keys %$section) {
         docout(\*DOC, $key, $section->{$key});
     }
     print DOC "\n=back\n";
@@ -251,6 +255,7 @@ close(DOC) or die "Error closing pod/perlapi.pod: $!";
 safer_unlink "pod/perlintern.pod";
 open(GUTS, ">pod/perlintern.pod") or
                die "Unable to create pod/perlintern.pod: $!\n";
+binmode GUTS;
 print GUTS <<'END';
 =head1 NAME