Skip to content

Commit

Permalink
(perl #123724) don't translate ... to ..\.. on Win32
Browse files Browse the repository at this point in the history
Apparently this was a command.com thing that Win32 doesn't support.
  • Loading branch information
tonycoz committed Jan 14, 2019
1 parent 7397626 commit 97fc2df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 0 additions & 10 deletions dist/PathTools/lib/File/Spec/Win32.pm
Expand Up @@ -407,16 +407,6 @@ sub _canon_cat # @path -> path
)+ # performance boost -- I do not know why
}{\\}gx;

# XXX I do not know whether more dots are supported by the OS supporting
# this ... annotation (NetWare or symbian but not MSWin32).
# Then .... could easily become ../../.. etc:
# Replace \.\.\. by (\.\.\.+) and substitute with
# { $1 . ".." . "\\.." x (length($2)-2) }gex
# ... --> ../..
$path =~ s{ (\A|\\) # at begin or after a slash
\.\.\.
(?=\\|\z) # at end or followed by slash
}{$1..\\..}gx;
# xx\yy\..\zz --> xx\zz
while ( $path =~ s{(?:
(?:\A|\\) # at begin or after a slash
Expand Down
4 changes: 2 additions & 2 deletions dist/PathTools/t/Spec.t
Expand Up @@ -277,9 +277,9 @@ my @tests = (
[ "Win32->canonpath('//a/b/../../c')", '\\\\a\\b\\c' ],
[ "Win32->canonpath('//a/b/c/../d')", '\\\\a\\b\\d' ],
[ "Win32->canonpath('//a/b/c/../../d')",'\\\\a\\b\\d' ],
[ "Win32->canonpath('//a/b/c/.../d')", '\\\\a\\b\\d' ],
[ "Win32->canonpath('//a/b/c/.../d')", '\\\\a\\b\\c\\...\\d' ],
[ "Win32->canonpath('/a/b/c/../../d')", '\\a\\d' ],
[ "Win32->canonpath('/a/b/c/.../d')", '\\a\\d' ],
[ "Win32->canonpath('/a/b/c/.../d')", '\\a\\b\\c\\...\\d' ],
[ "Win32->canonpath('\\../temp\\')", '\\temp' ],
[ "Win32->canonpath('\\../')", '\\' ],
[ "Win32->canonpath('\\..\\')", '\\' ],
Expand Down

0 comments on commit 97fc2df

Please sign in to comment.