From: Nicholas Clark Date: Fri, 16 Jul 2004 11:14:45 +0000 (+0000) Subject: glob('*.c') to find documentation is dangerous when run in unclean X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69e39a9aeaf661e41da7db0001d9c91f3c2c89c7;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/autodoc.pl b/autodoc.pl index da05962..c87f114 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: $!"; + ; +}; + +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);