diff options
author | Steve Hay <SteveHay@planit.com> | 2004-02-06 16:14:14 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-02-08 11:44:22 +0000 |
commit | cac3fadd5244efab88a7d39b605730c92b4ac22c (patch) | |
tree | c84587f3d6cc9908af44f1fc387b335bd2977560 /installhtml | |
parent | f5b005ca88f5f6ed7eaad9335c79e59a5874c00a (diff) | |
download | perl-cac3fadd5244efab88a7d39b605730c92b4ac22c.tar.gz |
Fix absolute path handling in installhtml
Message-ID: <4023BD56.6090903@uk.radan.com>
p4raw-id: //depot/perl@22285
Diffstat (limited to 'installhtml')
-rwxr-xr-x | installhtml | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/installhtml b/installhtml index 967f0c6d1e..5a76ba099f 100755 --- a/installhtml +++ b/installhtml @@ -4,6 +4,7 @@ use strict; use Config; # for config options in the makefile +use File::Spec; use Getopt::Long; # for command-line parsing use Cwd; use Pod::Html 'anchorify'; @@ -293,15 +294,6 @@ sub parse_command_line { } -sub absolute_path { - my($cwd, $path) = @_; - return "$cwd/$path" unless $path =~ m:/:; - # add cwd if path is not already an absolute path - $path = "$cwd/$path" if (substr($path,0,1) ne '/'); - return $path; -} - - sub create_index { my($html, $dir) = @_; (my $pod = $dir) =~ s,^.*/,,; @@ -391,8 +383,8 @@ sub split_on_item { print "splitting files by item.\n" if $verbose && $#splititem >= 0; $pwd = getcwd(); - my $splitter = absolute_path($pwd, "$splitpod/splitpod"); - my $perl = absolute_path($pwd, $^X); + my $splitter = File::Spec->rel2abs("$splitpod/splitpod", $pwd); + my $perl = File::Spec->rel2abs($^X, $pwd); foreach my $pod (@splititem) { # figure out the directory to split into $pod =~ s,^([^/]*)$,/$1,; |