New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File::Spec->canonpath("a\\..\\..\\b") returns wrong value for Win 32 #7133
Comments
From Tom.Dinger@Scansoft.comCreated by tom.dinger@scansoft.comUnder Windows (using File::Spec::Win32), the call This bug first appeared in the Perl 5.8.1 release; Perl 5.8.0 does not In Perl 5.8.0, the behavior of canonpath() for Win32.pm was very similar In Perl 5.8.1, a number of multiple-dot transformations were added to the Compounding the problem is that canonpath() is used by other functions Attached is acontext-diff of the changes I have made and tested for the ################################################################### Inline Patch--- lib\File\Spec\Win32.pm.orig Tue Sep 16 01:54:20 2003
+++ lib\File\Spec\Win32.pm Tue Feb 24 13:05:22 2004
@@ -5,7 +5,7 @@
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.4';
+$VERSION = '1.5';
@ISA = qw(File::Spec::Unix);
@@ -140,28 +140,53 @@
$path =~ s{^\\\.\.$}{\\}; # \.. -> \
1 while $path =~ s{^\\\.\.}{}; # \..\xx -> \xx
- my ($vol,$dirs,$file) = $self->splitpath($path);
- my @dirs = $self->splitdir($dirs);
- my (@base_dirs, @path_dirs);
- my $dest = \@base_dirs;
- for my $dir (@dirs){
- $dest = \@path_dirs if $dir eq $self->updir;
- push @$dest, $dir;
- }
- # for each .. in @path_dirs pop one item from
- # @base_dirs
- while (my $dir = shift @path_dirs){
- unless ($dir eq $self->updir){
- unshift @path_dirs, $dir;
- last;
- }
- pop @base_dirs;
- }
- $path = $self->catpath(
- $vol,
- $self->catdir(@base_dirs, @path_dirs),
- $file
- );
+ my ($vol,$dirs,$file) = $self->splitpath($path,1);
+
+ # The previous version of the code did completely the wrong thing in
+ # at least one important case:
+ #
+ # input result should be
+ # ----------- ------ ---------
+ # a\..\..\b\c b\c ..\b\c
+ #
+ # So this is a simpler rewrite.
+
+ my @dirs = $self->splitdir( $dirs );
+
+ # We walk through the list, looking for pairs ("x\..") to toss,
+ # e.g. "a\x\..\b" --> "a\b".
+ # But if the previous element is '..' we cannot toss this one.
+ # If the previous element is '', we can toss this one, but not the
+ # previous one (it stands for the root of the file system).
+
+ for ( my $i = 1; $i < @dirs; )
+ {
+ if ( ($i == 0) or ($dirs[$i] ne $self->updir) )
+ {
+ ++$i; # skip this one, nothing to do.
+ }
+ elsif ( ($i == 1) and ($dirs[$i-1] eq '') )
+ {
+ # E.g. "C:\..\stuff" --> "C:\stuff"
+ splice @dirs, $i, 1; # and leave $i alone.
+ }
+ elsif ( $dirs[$i-1] ne $self->updir )
+ {
+ # E.g. "a\b\..\c" --> "a\c"
+ splice @dirs, $i - 1, 2;
+ --$i; # the next one to check
+ }
+ else
+ {
+ ++$i; # don't remove this one.
+ }
+ }
+
+ $path = $self->catpath( $vol, $self->catdir(@dirs), $file );
+
+# $path .= '.' if substr($path,-1,1) eq ':'; # change "X:" into "X:."
+ $path .= '.' if $path eq ''; # change "" into "."
+
return $path;
}
--- lib\File\Spec\t\Spec.t.orig Fri Dec 19 09:01:46 2003
+++ lib\File\Spec\t\Spec.t Tue Feb 24 13:07:32 2004
@@ -201,6 +201,10 @@
[ "Win32->catfile('.\\a','b','c')", 'a\\b\\c' ],
[ "Win32->catfile('c')", 'c' ],
[ "Win32->catfile('.\\c')", 'c' ],
+[ "Win32->catfile('a','b','..','.\\c')", 'a\\c' ],
+[ "Win32->catfile('a','..','b','.\\c')", 'b\\c' ],
+[ "Win32->catfile('a','..','..','b','.\\c')", '..\\b\\c' ],
+[ "Win32->catfile('..','a','b','.\\c')", '..\\a\\b\\c' ],
[ "Win32->canonpath('')", '' ],
@@ -224,6 +228,15 @@
[ "Win32->canonpath('\\..\\')", '\\' ],
[ "Win32->canonpath('/../')", '\\' ],
[ "Win32->canonpath('/..\\')", '\\' ],
+[ "Win32->canonpath('..\\a')", '..\\a' ],
+[ "Win32->canonpath('..\\..\\a')", '..\\..\\a' ],
+[ "Win32->canonpath('a\\..\\..\\b')", '..\\b' ],
+[ "Win32->canonpath('a\\..\\..\\b\\..\\c\\d\\..\\e')", '..\\c\\e' ],
+[ "Win32->canonpath('c:\\a\\..')", 'C:\\' ],
+[ "Win32->canonpath('c:a\\..')", 'C:' ],
+[ "Win32->canonpath('c:\\a\\..\\')", 'C:\\' ],
+[ "Win32->canonpath('c:a\\..\\')", 'C:' ],
+[ "Win32->canonpath('a\\..\\')", '.' ],
[ "Win32->can('_cwd')", '/CODE/' ],
# FakeWin32 subclass (see below) just sets CWD to C:\one\two
################################################################### Perl Info
|
From @schwern[tomdinger - Tue Feb 24 10:15:24 2004]:
Hey Ken, want to have a look at this? There's a patch and everything! |
The RT System itself - Status changed from 'new' to 'open' |
From @kenahooOn Jul 6, 2005, at 11:29 AM, Michael G Schwern via RT wrote:
If Win32 is going to be handled like Unix, then it should return the -Ken |
From @schwernOn Wed, Jul 06, 2005 at 02:06:19PM -0500, Ken Williams wrote:
That's not the issue. b\c is right out wrong. Examine the path closer. a\..\..\b\c "a\.." cancels out leaving "..\b\c". Or, if you don't want to clean up .. it can be a\..\..\b\c. But b\c is PS Offhand the reason I can think for cleaning up .. on Win32 is because it -- |
From @kenahooOn Jul 6, 2005, at 2:50 PM, Michael G Schwern wrote:
Right, I understand the bug, I'm just trying to get the right fix.
"tends not to" isn't a good enough reason in this case. If it treats -Ken |
From @kenahooOn Jul 6, 2005, at 4:00 PM, Dinger, Tom wrote:
Of course. That's what I'm asking: is "bar" guaranteed on Windows to I've never disputed the bug. The current behavior is obviously wrong. -Ken |
From perl@nevcal.comOn approximately 7/6/2005 1:10 PM, came the following characters from
So how do Windows' "shortcuts" fit into this? They act a lot like And then the newer versions of NTFS support "reparse points" and Hence potentially making a\.. elimination problematical. Which may bea --
|
From Tom.Dinger@Scansoft.comTo be perfectly honest, I don't care which way it is "fixed", as long as the And now some history: the version of File::Spec::Win32 in Perl 5.8.0 did no Either roll back that method to the 5.8.0 version, or apply the patch. The TD -----Original Message----- On Jul 6, 2005, at 2:50 PM, Michael G Schwern wrote:
Right, I understand the bug, I'm just trying to get the right fix.
"tends not to" isn't a good enough reason in this case. If it treats -Ken |
From @JohnPeacockGlenn Linderman wrote:
Shortcuts are an abomination; don't try and support them (AFAIK only Explorer
NTFS has had hard links for files for some time, but only with a developer tool. /These aren't the droids we're looking for. Move along, move along!/ John -- |
From @demerphqOn 7/6/05, Ken Williams <ken@mathforum.org> wrote:
Im not sure if this is useful, but many of the things that File::Spec Win32::GetFullPathName() is the one i have in mind when I say this. perl -e "use Win32; print Win32::GetFullPathName(qq[foo\\..\\bar]);" outputs "CWD\bar". So if you strip off the CWD from the result of use Win32; sub canonpath { print canonpath("foo/../../../bar/baz"); BTW, i say crudely, because I dont think that canonpath is very well Likewise, File::Spec::rel2abs() should be rewritten to be a Anyway, the point is that using Win32::GetFullPathName() is available Yves -- |
From @kenahooOn Jul 8, 2005, at 8:51 AM, yves orton via RT wrote:
Yeah, very true. However, the Win32 docs say that GetFullPathName()
If the input is relative, the output is relative. If the input is
True. The only problem is that it'll make it harder for me to test, Your basic point is well-taken, though - we should indeed use Win32::* -Ken |
From nick@ing-simmons.netKen Williams <ken@mathforum.org> writes:
Without (sym)links Win32 has simpler .. semantics than Unix.
|
From @schwernOn Fri, Jul 08, 2005 at 03:50:49PM +0200, demerphq wrote:
Does it? It still leaves us asking the question: can we assume foo\..\bar == Anyhow, should this discussion drag on any longer without resolution there's -- |
From @demerphqOn 7/8/05, Michael G Schwern <schwern@pobox.com> wrote:
Well, i suppose you are correct. Im not entirely sure what scenario I D:\dev\junct>junction foo Junction v1.03 - Win2K junction creator and reparse point viewer D:\dev\junct\foo: JUNCTION D:\dev\junct>echo Test1 > foo\..\test.echo D:\dev\junct>type test.echo D:\dev\junct>cd .. D:\dev>echo test2 > test\..\test.echo D:\dev>type test.echo
Sure. My comment was mostly that by using the Win32 API's one can do To be honest i would really like to see the expected behaviour of -- |
From @schwernOn Fri, Jul 08, 2005 at 11:07:22PM +0200, demerphq wrote:
I have the creeping feeling that there's an argument to be made here, but
canonpath() should never be inserting the CWD when cleaning up. "./bar" is -- |
From @demerphqOn 7/8/05, Michael G Schwern <schwern@pobox.com> wrote:
Me too. Not being all that familiar with *nix file systems I made my
Sorry, i guess I didnt express myself properly. You cant clean up a ..\..\foo If we are in \bar then ..\..\foo is the same as ..\foo and \foo but yves -- |
From perl@nevcal.comOn approximately 7/8/2005 1:53 PM, came the following characters from
In the presence of junction points, I think not. The system call would
--
|
From @demerphqOn 7/8/05, Glenn Linderman <perl@nevcal.com> wrote:
Doesn't look like there is a problem with this. I guess ".." is D:\dev\junct\foo>perl -MWin32 -e"print Win32::GetFullPathName('.');" D:\dev\test>perl -MWin32 -e"print Win32::GetFullPathName('.');" D:\dev>junction junct\foo Junction v1.03 - Win2K junction creator and reparse point viewer D:\dev\junct\foo: JUNCTION -- |
From perl@nevcal.comOn approximately 7/8/2005 2:07 PM, came the following characters from
OK, you have just proven that the file is the same whether accessed by d: showing all the prompts that display the current path name in the sequence? And even then, one would have to test the function of GetFullPathName
Actually, if you knew that GetFullPathName was sensitive to and properly
--
|
From @kenahooOn Jul 8, 2005, at 4:26 PM, Michael G Schwern wrote:
It's been in the File::Spec docs for a couple versions now, because http://search.cpan.org/~kwilliams/PathTools-3.09/lib/File/Spec/Unix.pm -Ken |
From @schwernOn Fri, Jul 08, 2005 at 11:49:59PM +0200, demerphq wrote:
Reason #982983 to leave .. alone. Your proposed "cleanup" is actually changing the meaning of the path. Would would be nice is some sort of collapse() method which does collapse I like this solution. canonpath() can remain strict and work the same -- |
From @kenahooOn Jul 8, 2005, at 4:50 PM, yves orton via RT wrote:
The current working directory is not considered in canonpath(), period. -Ken |
From @schwernOk, enough dithering. Let's squash this. Attached is a patch which fixes this bug so canonpath("a\\..\\..\\b\\c") The patch replaces the collapse code in Win32->canonpath() with |
From @schwernbug27052.patch--- old-PathTools-3.09/lib/File/Spec/Unix.pm 2005-07-08 16:22:17.000000000 -0700
+++ new-PathTools-3.09/lib/File/Spec/Unix.pm 2005-07-08 16:23:47.000000000 -0700
@@ -472,4 +472,40 @@
Cwd::cwd();
}
+
+# Internal method to reduce xx\..\yy -> yy
+sub _collapse {
+ my($fs, $path) = @_;
+
+ my $updir = $fs->updir;
+ my $curdir = $fs->curdir;
+
+ my($vol, $dirs, $file) = $fs->splitpath($path);
+ my @dirs = $fs->splitdir($dirs);
+
+ my @collapsed;
+ push @collapsed, $curdir unless $fs->file_name_is_absolute($path);
+
+ foreach my $dir (@dirs) {
+ if( $dir eq $updir and # if we have an updir
+ @collapsed and # and something to collapse
+ length $collapsed[-1] and # and its not the rootdir
+ $collapsed[-1] ne $updir and # nor another updir
+ $collapsed[-1] ne $curdir # nor the curdir
+ )
+ { # then
+ pop @collapsed; # collapse
+ }
+ else { # else
+ push @collapsed, $dir; # just hang onto it
+ }
+ }
+
+ return $fs->catpath($vol,
+ $fs->catdir(@collapsed),
+ $file
+ );
+}
+
+
1;
--- old-PathTools-3.09/lib/File/Spec/Win32.pm 2005-07-08 16:22:17.000000000 -0700
+++ new-PathTools-3.09/lib/File/Spec/Win32.pm 2005-07-08 16:24:10.000000000 -0700
@@ -145,29 +145,7 @@
return $path unless $path =~ /\.\./; # too few .'s to cleanup
return $path if $path =~ /\.\.\.\./; # too many .'s to cleanup
- my ($vol,$dirs,$file) = $self->splitpath($path);
- my @dirs = $self->splitdir($dirs);
- my (@base_dirs, @path_dirs);
- my $dest = \@base_dirs;
- for my $dir (@dirs){
- $dest = \@path_dirs if $dir eq $self->updir;
- push @$dest, $dir;
- }
- # for each .. in @path_dirs pop one item from
- # @base_dirs
- while (my $dir = shift @path_dirs){
- unless ($dir eq $self->updir){
- unshift @path_dirs, $dir;
- last;
- }
- pop @base_dirs;
- }
- $path = $self->catpath(
- $vol,
- $self->catdir(@base_dirs, @path_dirs),
- $file
- );
- return $path;
+ return $self->_collapse($path);
}
=item splitpath
--- old-PathTools-3.09/t/Spec.t 2005-07-08 16:22:17.000000000 -0700
+++ new-PathTools-3.09/t/Spec.t 2005-07-08 16:31:53.000000000 -0700
@@ -92,14 +92,16 @@
[ "Unix->catdir('','d1','d2','d3')", '/d1/d2/d3' ],
[ "Unix->catdir('d1','d2','d3')", 'd1/d2/d3' ],
-[ "Unix->canonpath('')", '' ],
[ "Unix->canonpath('///../../..//./././a//b/.././c/././')", '/a/b/../c' ],
-[ "Unix->canonpath('/.')", '/' ],
-[ "Unix->canonpath('/./')", '/' ],
-[ "Unix->canonpath('/a/./')", '/a' ],
-[ "Unix->canonpath('/a/.')", '/a' ],
-[ "Unix->canonpath('/../../')", '/' ],
-[ "Unix->canonpath('/../..')", '/' ],
+[ "Unix->canonpath('')", '' ],
+# rt.perl.org 27052
+[ "Unix->canonpath('a/../../b/c')", 'a/../../b/c' ],
+[ "Unix->canonpath('/.')", '/' ],
+[ "Unix->canonpath('/./')", '/' ],
+[ "Unix->canonpath('/a/./')", '/a' ],
+[ "Unix->canonpath('/a/.')", '/a' ],
+[ "Unix->canonpath('/../../')", '/' ],
+[ "Unix->canonpath('/../..')", '/' ],
[ "Unix->abs2rel('/t1/t2/t3','/t1/t2/t3')", '' ],
[ "Unix->abs2rel('/t1/t2/t4','/t1/t2/t3')", '../t4' ],
@@ -214,6 +216,8 @@
[ "Win32->canonpath('a:')", 'A:' ],
[ "Win32->canonpath('A:f')", 'A:f' ],
[ "Win32->canonpath('A:/')", 'A:\\' ],
+# rt.perl.org 27052
+[ "Win32->canonpath('a\\..\\..\\b\\c')", '..\\b\\c' ],
[ "Win32->canonpath('//a\\b//c')", '\\\\a\\b\\c' ],
[ "Win32->canonpath('/a/..../c')", '\\a\\....\\c' ],
[ "Win32->canonpath('//a/b\\c')", '\\\\a\\b\\c' ],
|
From @demerphqOn 7/9/05, Ken Williams <ken@mathforum.org> wrote:
As I said before, the docs DONT specify what canonpath() is for very One can infer almost any behaviour from "cleans up the path". And IMO, Im happy with the behaviour you outline, and i think i like Schwern's OTOH, i still think canonpath for absolute paths on Win32 should use yves |
From @demerphqOn 7/9/05, Glenn Linderman <perl@nevcal.com> wrote:
im not sure if your script exploited the structure i set up properly or not. I had d:\dev\junct\foo -> d:\dev\test so creating a directory in junct doesnt create it in test. Heres the D:\dev>junction junct\foo Junction v1.03 - Win2K junction creator and reparse point viewer D:\dev\junct\foo: JUNCTION D:\dev>junct.bat D:\dev>d: D:\dev>md \dev\junct\bar D:\dev>cd \dev\junct D:\dev\junct>cd foo\..\bar D:\dev\junct\bar>cd .. D:\dev\junct>cd foo D:\dev\junct\foo>cd .. D:\dev\junct>cd \dev\test D:\dev\test>cd foo\..\bar D:\dev\test>cd .. D:\dev>cd foo D:\dev>cd .. D:\>cd dev\test D:\dev\test>dir Directory of D:\dev\test 2005-07-08 16:24 <DIR> . D:\dev\test>md foo D:\dev\test>cd .. D:\dev>junct.bat D:\dev>d: D:\dev>md \dev\junct\bar D:\dev>cd \dev\junct D:\dev\junct>cd foo\..\bar D:\dev\junct\bar>cd .. D:\dev\junct>cd foo D:\dev\junct\foo>cd .. D:\dev\junct>cd \dev\test D:\dev\test>cd foo\..\bar D:\dev\test>cd .. D:\dev>cd foo D:\dev>cd .. D:\>cd dev\test D:\dev\test>dir Directory of D:\dev\test 2005-07-09 08:35 <DIR> . D:\dev\test>cd foo D:\dev\test\foo>cd .. D:\dev\test>md bar D:\dev\test>cd .. D:\dev>junct.bat D:\dev>d: D:\dev>md \dev\junct\bar D:\dev>cd \dev\junct D:\dev\junct>cd foo\..\bar D:\dev\junct\bar>cd .. D:\dev\junct>cd foo D:\dev\junct\foo>cd .. D:\dev\junct>cd \dev\test D:\dev\test>cd foo\..\bar D:\dev\test\bar>cd .. D:\dev\test>cd foo D:\dev\test\foo>cd .. D:\dev\test> -- |
From perl@nevcal.comOn approximately 7/8/2005 11:40 PM, came the following characters from
Oops. No it probably doesn't. You used foo differently than in my Although I think that in spite of my confusion, and the resulting
At this point the prompt being D:\dev\junct indicates that the previous I guess there would be more interesting tests, perhaps a hybrid of what d: --
|
From @schwernOn Sat, Jul 09, 2005 at 08:14:47AM +0200, demerphq wrote:
Yes, the docs stink. Patches welcome.
A) Why change what works? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfullpathname.asp C) Its not specified in the GetFullPathName() that it does the sort of D) File::Spec::Win32 will no longer work on non-Windows platforms making -- |
From @kenahooOn Jul 8, 2005, at 4:07 PM, demerphq wrote:
Could you try a scenario like the one outlined in the canonpath() docs http://search.cpan.org/~kwilliams/PathTools-3.09/lib/File/Spec/Unix.pm -Ken |
From @schwernOk, enough dithering. Let's kill this bug. File::Spec::Win32->canonpath() currently contains code to collapse .. so Attached is a patch to fix this bug. It replaces the collapsing code in |
From @schwernfs.patchdiff -rN -u old-PathTools-3.09/lib/File/Spec/Unix.pm new-PathTools-3.09/lib/File/Spec/Unix.pm
--- old-PathTools-3.09/lib/File/Spec/Unix.pm 2005-07-08 16:22:17.000000000 -0700
+++ new-PathTools-3.09/lib/File/Spec/Unix.pm 2005-07-08 16:23:47.000000000 -0700
@@ -472,4 +472,40 @@
Cwd::cwd();
}
+
+# Internal method to reduce xx\..\yy -> yy
+sub _collapse {
+ my($fs, $path) = @_;
+
+ my $updir = $fs->updir;
+ my $curdir = $fs->curdir;
+
+ my($vol, $dirs, $file) = $fs->splitpath($path);
+ my @dirs = $fs->splitdir($dirs);
+
+ my @collapsed;
+ push @collapsed, $curdir unless $fs->file_name_is_absolute($path);
+
+ foreach my $dir (@dirs) {
+ if( $dir eq $updir and # if we have an updir
+ @collapsed and # and something to collapse
+ length $collapsed[-1] and # and its not the rootdir
+ $collapsed[-1] ne $updir and # nor another updir
+ $collapsed[-1] ne $curdir # nor the curdir
+ )
+ { # then
+ pop @collapsed; # collapse
+ }
+ else { # else
+ push @collapsed, $dir; # just hang onto it
+ }
+ }
+
+ return $fs->catpath($vol,
+ $fs->catdir(@collapsed),
+ $file
+ );
+}
+
+
1;
diff -rN -u old-PathTools-3.09/lib/File/Spec/Win32.pm new-PathTools-3.09/lib/File/Spec/Win32.pm
--- old-PathTools-3.09/lib/File/Spec/Win32.pm 2005-07-08 16:22:17.000000000 -0700
+++ new-PathTools-3.09/lib/File/Spec/Win32.pm 2005-07-08 16:24:10.000000000 -0700
@@ -145,29 +145,7 @@
return $path unless $path =~ /\.\./; # too few .'s to cleanup
return $path if $path =~ /\.\.\.\./; # too many .'s to cleanup
- my ($vol,$dirs,$file) = $self->splitpath($path);
- my @dirs = $self->splitdir($dirs);
- my (@base_dirs, @path_dirs);
- my $dest = \@base_dirs;
- for my $dir (@dirs){
- $dest = \@path_dirs if $dir eq $self->updir;
- push @$dest, $dir;
- }
- # for each .. in @path_dirs pop one item from
- # @base_dirs
- while (my $dir = shift @path_dirs){
- unless ($dir eq $self->updir){
- unshift @path_dirs, $dir;
- last;
- }
- pop @base_dirs;
- }
- $path = $self->catpath(
- $vol,
- $self->catdir(@base_dirs, @path_dirs),
- $file
- );
- return $path;
+ return $self->_collapse($path);
}
=item splitpath
diff -rN -u old-PathTools-3.09/t/Spec.t new-PathTools-3.09/t/Spec.t
--- old-PathTools-3.09/t/Spec.t 2005-07-08 16:22:17.000000000 -0700
+++ new-PathTools-3.09/t/Spec.t 2005-07-08 16:31:53.000000000 -0700
@@ -92,14 +92,16 @@
[ "Unix->catdir('','d1','d2','d3')", '/d1/d2/d3' ],
[ "Unix->catdir('d1','d2','d3')", 'd1/d2/d3' ],
-[ "Unix->canonpath('')", '' ],
[ "Unix->canonpath('///../../..//./././a//b/.././c/././')", '/a/b/../c' ],
-[ "Unix->canonpath('/.')", '/' ],
-[ "Unix->canonpath('/./')", '/' ],
-[ "Unix->canonpath('/a/./')", '/a' ],
-[ "Unix->canonpath('/a/.')", '/a' ],
-[ "Unix->canonpath('/../../')", '/' ],
-[ "Unix->canonpath('/../..')", '/' ],
+[ "Unix->canonpath('')", '' ],
+# rt.perl.org 27052
+[ "Unix->canonpath('a/../../b/c')", 'a/../../b/c' ],
+[ "Unix->canonpath('/.')", '/' ],
+[ "Unix->canonpath('/./')", '/' ],
+[ "Unix->canonpath('/a/./')", '/a' ],
+[ "Unix->canonpath('/a/.')", '/a' ],
+[ "Unix->canonpath('/../../')", '/' ],
+[ "Unix->canonpath('/../..')", '/' ],
[ "Unix->abs2rel('/t1/t2/t3','/t1/t2/t3')", '' ],
[ "Unix->abs2rel('/t1/t2/t4','/t1/t2/t3')", '../t4' ],
@@ -214,6 +216,8 @@
[ "Win32->canonpath('a:')", 'A:' ],
[ "Win32->canonpath('A:f')", 'A:f' ],
[ "Win32->canonpath('A:/')", 'A:\\' ],
+# rt.perl.org 27052
+[ "Win32->canonpath('a\\..\\..\\b\\c')", '..\\b\\c' ],
[ "Win32->canonpath('//a\\b//c')", '\\\\a\\b\\c' ],
[ "Win32->canonpath('/a/..../c')", '\\a\\....\\c' ],
[ "Win32->canonpath('//a/b\\c')", '\\\\a\\b\\c' ],
|
From @rgarciaOn 7/12/05, Michael G Schwern via RT <perlbug-followup@perl.org> wrote:
What's the status of this patch ? applied to File::Spec ? rejected ? |
From @kenahooOn Jul 19, 2005, at 3:06 AM, Rafael Garcia-Suarez wrote:
Finally applied. -Ken |
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#27052 (status was 'resolved')
Searchable as RT27052$
The text was updated successfully, but these errors were encountered: