summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-07-16 11:14:45 +0000
committerNicholas Clark <nick@ccl4.org>2004-07-16 11:14:45 +0000
commit69e39a9aeaf661e41da7db0001d9c91f3c2c89c7 (patch)
tree82efa34aa266233026e2c104fb3d0d4d689a813a /autodoc.pl
parente90e236463307bd7f53439b91573fe42e9cb8901 (diff)
downloadperl-69e39a9aeaf661e41da7db0001d9c91f3c2c89c7.tar.gz
glob('*.c') to find documentation is dangerous when run in unclean
trees, so isntead use MANIFEST to only scan the legitimate source files. p4raw-id: //depot/perl@23127
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/autodoc.pl b/autodoc.pl
index da05962b45..c87f114fc8 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -6,7 +6,7 @@ require 5.003; # keep this compatible, an old perl is all we may have before
BEGIN {
push @INC, 'lib';
require 'regen_lib.pl';
-} # glob() below requires File::Glob
+}
#
@@ -140,7 +140,15 @@ removed without notice.\n\n" if $flags =~ /x/;
}
my $file;
-for $file (glob('*.c'), glob('*.h')) {
+# glob() picks up docs from extra .c or .h files that may be in unclean
+# development trees.
+my $MANIFEST = do {
+ local ($/, *FH);
+ open FH, "MANIFEST" or die "Can't open MANIFEST: $!";
+ <FH>;
+};
+
+for $file (($MANIFEST =~ /^(\S+\.c)\t/gm), ($MANIFEST =~ /^(\S+\.h)\t/gm)) {
open F, "< $file" or die "Cannot open $file for docs: $!\n";
$curheader = "Functions in file $file\n";
autodoc(\*F,$file);