Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 24921
Status: resolved
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: john [...] redux.org.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 3.09
  • 3.24
Fixed in: (no value)



Subject: File::Spec->abs2rel() provides an incorrect answer in some cases
In PathTools 3.09, File::Spec->abs2rel('.', '.') returns "", which isn't exactly a relative path, but could be considered to be correct I guess. In PathTools 3.24, the same call returns "/", no matter what your cwd is. This is definitely wrong - it's not even returning a relative path. beranej1@jberanek /tmp $ perl -MFile::Spec -e "print File::Spec->VERSION;" 3.24 beranej1@jberanek /tmp $ perl -MFile::Spec -e "print File::Spec->abs2rel('.','.');" / beranej1@jberanek /tmp $ perl -v This is perl, v5.8.8 built for x86_64-linux-thread-multi beranej1@jberanek /tmp $ cat /etc/redhat-release Fedora Core release 6 (Zod) beranej1@jberanek /tmp $ uname -a Linux jberanek.saltaire.pace.co.uk 2.6.19-1.2895.fc6 #1 SMP Wed Jan 10 18:50:56 EST 2007 x86_64 x86_64 x86_64 GNU/Linux ==== John.
From: jkeenan [...] cpan.org
On Tue Feb 13 05:59:59 2007, jberanek wrote: Show quoted text
> > In PathTools 3.09, File::Spec->abs2rel('.', '.') returns "", which isn't > exactly a relative path, but could be considered to be correct I guess. > > In PathTools 3.24, the same call returns "/", no matter what your cwd > is. This is definitely wrong - it's not even returning a relative path. >
Some additional data: $ perl -MFile::Spec -e "print File::Spec->VERSION, qq{\n};" 3.33 $ perl -MFile::Spec -e "print File::Spec->abs2rel('.','.'), qq{\n};" / $ perl -MFile::Spec -e "print File::Spec->abs2rel('.',''), qq{\n};" . $ perl -MFile::Spec -e "print File::Spec->abs2rel('.'), qq{\n};" . Observed on Darwin with Perl 5.14.2. Thank you very much. Jim Keenan
On Wed Dec 07 22:14:18 2011, JKEENAN wrote: Show quoted text
> On Tue Feb 13 05:59:59 2007, jberanek wrote:
> > > > In PathTools 3.09, File::Spec->abs2rel('.', '.') returns "", which isn't > > exactly a relative path, but could be considered to be correct I guess. > > > > In PathTools 3.24, the same call returns "/", no matter what your cwd > > is. This is definitely wrong - it's not even returning a relative path. > >
> > Some additional data: > > $ perl -MFile::Spec -e "print File::Spec->VERSION, qq{\n};" > 3.33 > > $ perl -MFile::Spec -e "print File::Spec->abs2rel('.','.'), qq{\n};" > / > $ perl -MFile::Spec -e "print File::Spec->abs2rel('.',''), qq{\n};" > . > $ perl -MFile::Spec -e "print File::Spec->abs2rel('.'), qq{\n};" > . > > Observed on Darwin with Perl 5.14.2. > > Thank you very much. > Jim Keenan
This appears to have been fixed. Observed on Darwin with Perl 5.18.0: ##### $ perl -MFile::Spec -e "print File::Spec->VERSION, qq{\n};" 3.40 $ perl -MFile::Spec -e "print File::Spec->abs2rel('.','.'), qq{\n};" . $ perl -MFile::Spec -e "print File::Spec->abs2rel('.',''), qq{\n};" . $ perl -MFile::Spec -e "print File::Spec->abs2rel('.'), qq{\n};" . ##### Maintainers: I believe this ticket can be closed. Thank you very much. Jim Keenan