diff options
author | Fred Drake <fdrake@acm.org> | 2001-05-29 19:53:46 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-05-29 19:53:46 (GMT) |
commit | 9a374186fcb824ec1cc022348d2a7c77316b54cc (patch) | |
tree | fb392fe9fedaf900b4a39c772fd4a7ad7549bfa6 /Doc/tools | |
parent | 96a2a80065603746e655ec4e7f2d6e488a5b9b36 (diff) | |
download | cpython-9a374186fcb824ec1cc022348d2a7c77316b54cc.zip cpython-9a374186fcb824ec1cc022348d2a7c77316b54cc.tar.gz cpython-9a374186fcb824ec1cc022348d2a7c77316b54cc.tar.bz2 |
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.
Diffstat (limited to 'Doc/tools')
-rwxr-xr-x | Doc/tools/node2label.pl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/tools/node2label.pl b/Doc/tools/node2label.pl index f8bc1a6..69f396a 100755 --- a/Doc/tools/node2label.pl +++ b/Doc/tools/node2label.pl @@ -10,9 +10,16 @@ require "labels.pl"; my $key; # sort so that we get a consistent assignment for nodes with multiple labels foreach $label (sort keys %external_labels) { - $key = $external_labels{$label}; - $key =~ s|^/||; - $nodes{$key} = $label; + # + # If the label can't be used as a filename on non-Unix platforms, + # skip it. Such labels may be used internally within the documentation, + # but will never be used for filename generation. + # + if ($label =~ /^([-.a-zA-Z0-9]+)$/) { + $key = $external_labels{$label}; + $key =~ s|^/||; + $nodes{$key} = $label; + } } # This adds the "internal" labels added for indexing. These labels will not |