my $cwd = Cwd::cwd();
my $new_dir = catdir $cwd, "t";
my $infile = catfile $new_dir, "$podfile.pod";
Prior to these changes, we were getting the volume from $cwd, above, and
then basically ignoring it. When the cwd was c:\foo, ignoring the
volume in the catdir/catfile operations would munge things to C:\foo,
which meant that later a native check of path prefix would fail:
C:\foo is not a prefix of c:\foo\bar because of the case difference in
the volume name.
The is a legitimate fix, but the code is still problematic in other
places because (a) it tends to do path operations with no consideration
for volumes and (b) it has at least one place where it decides whether
path X is below path Y by using substr/index instead of path checking
routines.
my $cwd = Cwd::cwd();
my ($vol, $dir) = splitpath($cwd, 1);
my $relcwd = substr($dir, length(File::Spec->rootdir()));
-
- my $new_dir = catdir $cwd, "t";
- my $infile = catfile $new_dir, "$podfile.pod";
- my $outfile = catfile $new_dir, "$podfile.html";
-
+
+ my $new_dir = catdir $dir, "t";
+ my $infile = catpath $vol, $new_dir, "$podfile.pod";
+ my $outfile = catpath $vol, $new_dir, "$podfile.html";
+
# To add/modify args to p2h, use @p2h_args
Pod::Html::pod2html(
"--infile=$infile",