Ticket #42568: patch-gtk-doc.mkdb.in-p0.diff

File patch-gtk-doc.mkdb.in-p0.diff, 3.7 KB (added by su-v, 11 years ago)

upstream fix as patch file (for port 'gtk-doc')

  • gtkdoc-mkdb.in

    From 685d03c624c3e5184198e191ac52b77d9b41c0bb Mon Sep 17 00:00:00 2001
    From: Daniel Macks <dmacks@netspace.org>
    Date: Wed, 19 Feb 2014 18:36:38 +0000
    Subject: mkdb: deref the array to not rely on new perl versions
    
    The previous code works in 5.14.2, but apparently not in 5.12.4.
    Fixes #724739
    ---
    diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
    index 9392892..1c25cb1 100755
    sub MarkDownParseBlocks { 
    47744774      # a heading is ended by any level less than or equal
    47754775      if ($md_block->{"level"} == 1) {
    47764776        if ($line =~ /^={4,}[ \t]*$/) {
    4777           my $text = pop $md_block->{"lines"};
     4777          my $text = pop @{$md_block->{"lines"}};
    47784778          $md_block->{"interrupted"} = 0;
    47794779          push @md_blocks, $md_block;
    47804780
    sub MarkDownParseBlocks { 
    47954795          next OUTER;
    47964796        } else {
    47974797          # push lines into the block until the end is reached
    4798           push $md_block->{"lines"}, $line;
     4798          push @{$md_block->{"lines"}}, $line;
    47994799          next OUTER;
    48004800        }
    48014801      } else {
    48024802        if ($line =~ /^[=]{4,}[ \t]*$/) {
    4803           my $text = pop $md_block->{"lines"};
     4803          my $text = pop @{$md_block->{"lines"}};
    48044804          $md_block->{"interrupted"} = 0;
    48054805          push @md_blocks, $md_block;
    48064806
    sub MarkDownParseBlocks { 
    48104810                        level => 1 };
    48114811          next OUTER;
    48124812        } elsif ($line =~ /^[-]{4,}[ \t]*$/) {
    4813           my $text = pop $md_block->{"lines"};
     4813          my $text = pop @{$md_block->{"lines"}};
    48144814          $md_block->{"interrupted"} = 0;
    48154815          push @md_blocks, $md_block;
    48164816
    sub MarkDownParseBlocks { 
    48314831          next OUTER;
    48324832        } else {
    48334833          # push lines into the block until the end is reached
    4834           push $md_block->{"lines"}, $line;
     4834          push @{$md_block->{"lines"}}, $line;
    48354835          next OUTER;
    48364836        }
    48374837      }
    sub MarkDownParseBlocks { 
    48424842                      text => "",
    48434843                      lines => [] };
    48444844      } else {
    4845         push $md_block->{"lines"}, $line;
     4845        push @{$md_block->{"lines"}}, $line;
    48464846      }
    48474847      next OUTER;
    48484848    }
    sub MarkDownParseBlocks { 
    48554855    if ($md_block->{"type"} eq "quote") {
    48564856      if (!$md_block->{"interrupted"}) {
    48574857        $line =~ s/^[ ]*>[ ]?//;
    4858         push $md_block->{"lines"}, $line;
     4858        push @{$md_block->{"lines"}}, $line;
    48594859        next OUTER;
    48604860      }
    48614861    } elsif ($md_block->{"type"} eq "li") {
    sub MarkDownParseBlocks { 
    48634863      if ($line =~ /^([ ]{0,3})($marker)[ ](.*)/) {
    48644864        my $indentation = $1;
    48654865        if ($md_block->{"indentation"} ne $indentation) {
    4866           push $md_block->{"lines"}, $line;
     4866          push @{$md_block->{"lines"}}, $line;
    48674867        } else {
    48684868          my $lines = $3;
    48694869          my $ordered = $md_block->{"ordered"};
    sub MarkDownParseBlocks { 
    48834883
    48844884      if ($md_block->{"interrupted"}) {
    48854885        if ($first_char eq " ") {
    4886           push $md_block->{"lines"}, "";
     4886          push @{$md_block->{"lines"}}, "";
    48874887          $line =~ s/^[ ]{0,4}//;
    4888           push $md_block->{"lines"}, $line;
     4888          push @{$md_block->{"lines"}}, $line;
    48894889          $md_block->{"interrupted"} = 0;
    48904890          next OUTER;
    48914891        }
    48924892      } else {
    48934893        $line =~ s/^[ ]{0,4}//;
    4894         push $md_block->{"lines"}, $line;
     4894        push @{$md_block->{"lines"}}, $line;
    48954895        next OUTER;
    48964896      }
    48974897    }
    sub MarkDownOutputDocBook { 
    53635363      }
    53645364
    53655365      if ($block->{"interrupted"}) {
    5366         push $block->{"lines"}, "";
     5366        push @{$block->{"lines"}}, "";
    53675367      }
    53685368
    53695369      $text = &MarkDownParseLines ($block->{"lines"}, $symbol, "li");