From: Anders Johnson Date: Fri, 12 Dec 2003 14:07:40 +0000 (-0800) Subject: RE: [perl #24610] Pod::Html infinite recursion X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=99a6169dfdb8b2356f889b4575ec1f2642a7f5fa;p=p5sagit%2Fp5-mst-13.2.git RE: [perl #24610] Pod::Html infinite recursion Message-ID: <33171CC36240D94EAF1FE584B1D14E0A06EC6F51@mail-sc-11.nvidia.com> (with tweaks) p4raw-id: //depot/perl@21884 --- diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index c4af19c..3f69720 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -3,7 +3,7 @@ use strict; require Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); -$VERSION = 1.0501; +$VERSION = 1.0502; @ISA = qw(Exporter); @EXPORT = qw(pod2html htmlify); @EXPORT_OK = qw(anchorify); @@ -78,6 +78,20 @@ section. By default, no headers are generated. Displays the usage message. +=item hiddendirs + + --hiddendirs + --nohiddendirs + +Include hidden directories in the search for POD's in podpath if recurse +is set. +The default is not to traverse any directory whose name begins with C<.>. +See L and L. + +[This option is for backward compatibility only. +It's hard to imagine that one would usefully create a module with a +name component beginning with C<.>.] + =item htmldir --htmldir=name @@ -213,6 +227,7 @@ my $Css; my $Recurse; my $Quiet; +my $HiddenDirs; my $Verbose; my $Doindex; @@ -604,6 +619,7 @@ Usage: $0 --help --htmlroot= --infile= --outfile= --flush - flushes the item and directory caches. --[no]header - produce block header/footer (default is no headers). --help - prints this message. + --hiddendirs - search hidden directories in podpath --htmldir - directory for resulting HTML files. --htmlroot - http-server base directory from which all relative paths in podpath stem (default is /). @@ -636,7 +652,7 @@ sub parse_command_line { my ($opt_backlink,$opt_cachedir,$opt_css,$opt_flush,$opt_header,$opt_help, $opt_htmldir,$opt_htmlroot,$opt_index,$opt_infile,$opt_libpods, $opt_netscape,$opt_outfile,$opt_podpath,$opt_podroot,$opt_quiet, - $opt_recurse,$opt_title,$opt_verbose); + $opt_recurse,$opt_title,$opt_verbose,$opt_hiddendirs); unshift @ARGV, split ' ', $Config{pod2html} if $Config{pod2html}; my $result = GetOptions( @@ -646,6 +662,7 @@ sub parse_command_line { 'flush' => \$opt_flush, 'header!' => \$opt_header, 'help' => \$opt_help, + 'hiddendirs!'=> \$opt_hiddendirs, 'htmldir=s' => \$opt_htmldir, 'htmlroot=s' => \$opt_htmlroot, 'index!' => \$opt_index, @@ -676,6 +693,7 @@ sub parse_command_line { $Htmlroot = $opt_htmlroot if defined $opt_htmlroot; $Doindex = $opt_index if defined $opt_index; $Podfile = $opt_infile if defined $opt_infile; + $HiddenDirs = $opt_hiddendirs if defined $opt_hiddendirs; $Htmlfile = $opt_outfile if defined $opt_outfile; $Podroot = $opt_podroot if defined $opt_podroot; $Quiet = $opt_quiet if defined $opt_quiet; @@ -921,7 +939,9 @@ sub scan_dir { opendir(DIR, $dir) || die "$0: error opening directory $dir: $!\n"; while (defined($_ = readdir(DIR))) { - if (-d "$dir/$_" && $_ ne "." && $_ ne "..") { # directory + if (-d "$dir/$_" && $_ ne "." && $_ ne ".." + && ($HiddenDirs || !/^\./) + ) { # directory $Pages{$_} = "" unless defined $Pages{$_}; $Pages{$_} .= "$dir/$_:"; push(@subdirs, $_);