Subject: | [PATCH] rmtree nit when handling file in VMS syntax |
Sorry to always be the bearer of ugly exceptions to exceptions, but I've checked the attached
into blead as #32276 to get around the following problem. When an individual file already in
VMS syntax was passed to rmtree -- and that file was a relative path with at least one directory
included in the name -- we were passing an invalid combination of Unix and VMS syntax to
vmsify, and getting a garbage result. Basically, for the following two examples, we had to
prevent the second one from happening.
'file.dat' --> vmsifiy('./file.dat')
'[.foo]file.dat' --> vmsify('./[.foo]file.dat') # garbage in, garbage out
Subject: | filepathfix.patch.txt |
--- lib/File/Path.pm;-0 Wed Oct 24 08:44:46 2007
+++ lib/File/Path.pm Sat Nov 10 19:50:04 2007
@@ -17,7 +17,7 @@ BEGIN {
use Exporter ();
use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '2.02';
+$VERSION = '2.02_01';
@ISA = qw(Exporter);
@EXPORT = qw(mkpath rmtree);
@@ -340,7 +340,9 @@ sub _rmtree {
# not a directory
$root = VMS::Filespec::vmsify("./$root")
- if $Is_VMS && !File::Spec->file_name_is_absolute($root);
+ if $Is_VMS
+ && !File::Spec->file_name_is_absolute($root)
+ && ($root !~ m/(?<!\^)[\]>]+/); # not already in VMS syntax
if ($arg->{safe} &&
($Is_VMS ? !&VMS::Filespec::candelete($root)