From ac2b477c8b4b647797d42877de5b1a1d34c94073 Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Wed, 22 Feb 2012 09:33:45 -0500 Subject: unixify paths a bit more systematicaly in Pod-Html Rather than unixifying paths sort of once off, we now do what I threatened earlier: unixify all the --switch supplied paths during command line parsing. There are other bits of File::Spec being sprinkled around, quite possibly in too-interior sections of the program, but this change gets *all* tests passing on Win32 as well as GNU/Linux. I think an audit of filepath normalization "border security" is still due, but this may tide us over for now. --- ext/Pod-Html/lib/Pod/Html.pm | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm index d2c2cb2955..694c5b07e5 100644 --- a/ext/Pod-Html/lib/Pod/Html.pm +++ b/ext/Pod-Html/lib/Pod/Html.pm @@ -289,12 +289,6 @@ sub pod2html { $Htmlroot = "" if $Htmlroot eq "/"; $Htmldir =~ s#/\z##; - # I think this, and many other unixifications, belongs in - # parse_command_line or some other higher-level location to get them all - # unixified at once. Right now, I think we may be unixifying things too - # late and ad hoc. -- rjbs, 2012-02-21 - $Htmlfile = _unixify($Htmlfile); - if ( $Htmlroot eq '' && defined( $Htmldir ) && $Htmldir ne '' @@ -508,21 +502,21 @@ sub parse_command_line { @Podpath = split(":", $opt_podpath) if defined $opt_podpath; - $Backlink = $opt_backlink if defined $opt_backlink; - $Cachedir = $opt_cachedir if defined $opt_cachedir; - $Css = $opt_css if defined $opt_css; - $Header = $opt_header if defined $opt_header; - $Htmldir = $opt_htmldir if defined $opt_htmldir; - $Htmlroot = $opt_htmlroot if defined $opt_htmlroot; - $Doindex = $opt_index if defined $opt_index; - $Podfile = $opt_infile if defined $opt_infile; - $Htmlfile = $opt_outfile if defined $opt_outfile; - $Poderrors = $opt_poderrors if defined $opt_poderrors; - $Podroot = $opt_podroot if defined $opt_podroot; - $Quiet = $opt_quiet if defined $opt_quiet; - $Recurse = $opt_recurse if defined $opt_recurse; - $Title = $opt_title if defined $opt_title; - $Verbose = $opt_verbose if defined $opt_verbose; + $Backlink = $opt_backlink if defined $opt_backlink; + $Cachedir = _unixify($opt_cachedir) if defined $opt_cachedir; + $Css = $opt_css if defined $opt_css; + $Header = $opt_header if defined $opt_header; + $Htmldir = _unixify($opt_htmldir) if defined $opt_htmldir; + $Htmlroot = _unixify($opt_htmlroot) if defined $opt_htmlroot; + $Doindex = $opt_index if defined $opt_index; + $Podfile = _unixify($opt_infile) if defined $opt_infile; + $Htmlfile = _unixify($opt_outfile) if defined $opt_outfile; + $Poderrors = $opt_poderrors if defined $opt_poderrors; + $Podroot = _unixify($opt_podroot) if defined $opt_podroot; + $Quiet = $opt_quiet if defined $opt_quiet; + $Recurse = $opt_recurse if defined $opt_recurse; + $Title = $opt_title if defined $opt_title; + $Verbose = $opt_verbose if defined $opt_verbose; warn "Flushing directory caches\n" if $opt_verbose && defined $opt_flush; -- cgit v1.2.1