Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a37418

Browse files
committed
New solution to the "Someone stuck a colon in that filename!" problem:
Allow colons in the labels used for internal references, but do not expose them when generating filename.
1 parent 96a2a80 commit 9a37418

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Doc/tools/node2label.pl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@
1010
my $key;
1111
# sort so that we get a consistent assignment for nodes with multiple labels
1212
foreach $label (sort keys %external_labels) {
13-
$key = $external_labels{$label};
14-
$key =~ s|^/||;
15-
$nodes{$key} = $label;
13+
#
14+
# If the label can't be used as a filename on non-Unix platforms,
15+
# skip it. Such labels may be used internally within the documentation,
16+
# but will never be used for filename generation.
17+
#
18+
if ($label =~ /^([-.a-zA-Z0-9]+)$/) {
19+
$key = $external_labels{$label};
20+
$key =~ s|^/||;
21+
$nodes{$key} = $label;
22+
}
1623
}
1724

1825
# This adds the "internal" labels added for indexing. These labels will not

0 commit comments

Comments
 (0)