summaryrefslogtreecommitdiff
path: root/scripts/get_abi.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/get_abi.pl')
-rwxr-xr-xscripts/get_abi.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index 116f0c33c16d..329ace635ac2 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -194,6 +194,8 @@ sub parse_abi {
# Outputs the book on ReST format
#
+my %labels;
+
sub output_rest {
foreach my $what (sort {
($data{$a}->{type} eq "File") cmp ($data{$b}->{type} eq "File") ||
@@ -217,6 +219,13 @@ sub output_rest {
$label =~ s,_+,_,g;
$label =~ s,_$,,;
+ # Avoid duplicated labels
+ while (defined($labels{$label})) {
+ my @chars = ("A".."Z", "a".."z");
+ $label .= $chars[rand @chars];
+ }
+ $labels{$label} = 1;
+
$data{$what}->{label} .= $label;
printf ".. _%s:\n\n", $label;