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 { |
4774 | 4774 | # a heading is ended by any level less than or equal |
4775 | 4775 | if ($md_block->{"level"} == 1) { |
4776 | 4776 | if ($line =~ /^={4,}[ \t]*$/) { |
4777 | | my $text = pop $md_block->{"lines"}; |
| 4777 | my $text = pop @{$md_block->{"lines"}}; |
4778 | 4778 | $md_block->{"interrupted"} = 0; |
4779 | 4779 | push @md_blocks, $md_block; |
4780 | 4780 | |
… |
… |
sub MarkDownParseBlocks { |
4795 | 4795 | next OUTER; |
4796 | 4796 | } else { |
4797 | 4797 | # push lines into the block until the end is reached |
4798 | | push $md_block->{"lines"}, $line; |
| 4798 | push @{$md_block->{"lines"}}, $line; |
4799 | 4799 | next OUTER; |
4800 | 4800 | } |
4801 | 4801 | } else { |
4802 | 4802 | if ($line =~ /^[=]{4,}[ \t]*$/) { |
4803 | | my $text = pop $md_block->{"lines"}; |
| 4803 | my $text = pop @{$md_block->{"lines"}}; |
4804 | 4804 | $md_block->{"interrupted"} = 0; |
4805 | 4805 | push @md_blocks, $md_block; |
4806 | 4806 | |
… |
… |
sub MarkDownParseBlocks { |
4810 | 4810 | level => 1 }; |
4811 | 4811 | next OUTER; |
4812 | 4812 | } elsif ($line =~ /^[-]{4,}[ \t]*$/) { |
4813 | | my $text = pop $md_block->{"lines"}; |
| 4813 | my $text = pop @{$md_block->{"lines"}}; |
4814 | 4814 | $md_block->{"interrupted"} = 0; |
4815 | 4815 | push @md_blocks, $md_block; |
4816 | 4816 | |
… |
… |
sub MarkDownParseBlocks { |
4831 | 4831 | next OUTER; |
4832 | 4832 | } else { |
4833 | 4833 | # push lines into the block until the end is reached |
4834 | | push $md_block->{"lines"}, $line; |
| 4834 | push @{$md_block->{"lines"}}, $line; |
4835 | 4835 | next OUTER; |
4836 | 4836 | } |
4837 | 4837 | } |
… |
… |
sub MarkDownParseBlocks { |
4842 | 4842 | text => "", |
4843 | 4843 | lines => [] }; |
4844 | 4844 | } else { |
4845 | | push $md_block->{"lines"}, $line; |
| 4845 | push @{$md_block->{"lines"}}, $line; |
4846 | 4846 | } |
4847 | 4847 | next OUTER; |
4848 | 4848 | } |
… |
… |
sub MarkDownParseBlocks { |
4855 | 4855 | if ($md_block->{"type"} eq "quote") { |
4856 | 4856 | if (!$md_block->{"interrupted"}) { |
4857 | 4857 | $line =~ s/^[ ]*>[ ]?//; |
4858 | | push $md_block->{"lines"}, $line; |
| 4858 | push @{$md_block->{"lines"}}, $line; |
4859 | 4859 | next OUTER; |
4860 | 4860 | } |
4861 | 4861 | } elsif ($md_block->{"type"} eq "li") { |
… |
… |
sub MarkDownParseBlocks { |
4863 | 4863 | if ($line =~ /^([ ]{0,3})($marker)[ ](.*)/) { |
4864 | 4864 | my $indentation = $1; |
4865 | 4865 | if ($md_block->{"indentation"} ne $indentation) { |
4866 | | push $md_block->{"lines"}, $line; |
| 4866 | push @{$md_block->{"lines"}}, $line; |
4867 | 4867 | } else { |
4868 | 4868 | my $lines = $3; |
4869 | 4869 | my $ordered = $md_block->{"ordered"}; |
… |
… |
sub MarkDownParseBlocks { |
4883 | 4883 | |
4884 | 4884 | if ($md_block->{"interrupted"}) { |
4885 | 4885 | if ($first_char eq " ") { |
4886 | | push $md_block->{"lines"}, ""; |
| 4886 | push @{$md_block->{"lines"}}, ""; |
4887 | 4887 | $line =~ s/^[ ]{0,4}//; |
4888 | | push $md_block->{"lines"}, $line; |
| 4888 | push @{$md_block->{"lines"}}, $line; |
4889 | 4889 | $md_block->{"interrupted"} = 0; |
4890 | 4890 | next OUTER; |
4891 | 4891 | } |
4892 | 4892 | } else { |
4893 | 4893 | $line =~ s/^[ ]{0,4}//; |
4894 | | push $md_block->{"lines"}, $line; |
| 4894 | push @{$md_block->{"lines"}}, $line; |
4895 | 4895 | next OUTER; |
4896 | 4896 | } |
4897 | 4897 | } |
… |
… |
sub MarkDownOutputDocBook { |
5363 | 5363 | } |
5364 | 5364 | |
5365 | 5365 | if ($block->{"interrupted"}) { |
5366 | | push $block->{"lines"}, ""; |
| 5366 | push @{$block->{"lines"}}, ""; |
5367 | 5367 | } |
5368 | 5368 | |
5369 | 5369 | $text = &MarkDownParseLines ($block->{"lines"}, $symbol, "li"); |