diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-06-04 15:31:40 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-06-04 15:31:40 +0000 |
commit | d1ac88a6ec4648cdd21f66a0719af9e2c378f3cb (patch) | |
tree | 9c2c8515d5d6b6c85ef630d873086338a5863a4e | |
parent | 6f88f0e583eec42aec731b75b2d2890370585adf (diff) | |
download | MPC-d1ac88a6ec4648cdd21f66a0719af9e2c378f3cb.tar.gz |
ChangeLogTag: Wed Jun 4 10:30:35 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | modules/TemplateParser.pm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index 2070ba66..a9c97bfe 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -258,10 +258,12 @@ sub relative { substr($val, 0, 1) = uc(substr($val, 0, 1)); } - if (index($cwd, $val) == 0) { + my($icwd) = ($^O eq 'MSWin32' || $^O eq 'cygwin' ? lc($cwd) : $cwd); + my($ival) = ($^O eq 'MSWin32' || $^O eq 'cygwin' ? lc($val) : $val); + if (index($icwd, $ival) == 0) { my($count) = 0; - my($current) = $cwd; - substr($current, 0, length($val)) = ''; + my($current) = $icwd; + substr($current, 0, length($ival)) = ''; while($current =~ /^\\/) { $current =~ s/^\///; } @@ -271,13 +273,13 @@ sub relative { ++$count; } } - $val = '../' x $count; - $val =~ s/\/$//; + $ival = '../' x $count; + $ival =~ s/\/$//; if ($self->{'prjc'}->convert_slashes()) { - $val = $self->slash_to_backslash($val); + $ival = $self->slash_to_backslash($ival); } - substr($value, $start) =~ s/\$\([^)]+\)/$val/; - $whole = $val; + substr($value, $start) =~ s/\$\([^)]+\)/$ival/; + $whole = $ival; } } $start += length($whole); |