From: David Landgren <david@landgren.net>
Date: Thu, 7 Jun 2007 14:02:36 +0000 (+0200)
Subject: Re: [PATCH] Update File-Path to 2.00
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b92ffa59657e7ca52a768410e906a43ca1ce814e;p=p5sagit%2Fp5-mst-13.2.git

Re: [PATCH] Update File-Path to 2.00
Message-ID: <4667F3DC.9070203@landgren.net>

p4raw-id: //depot/perl@31349
---

diff --git a/lib/File/Path.pm b/lib/File/Path.pm
index fa13d3f..2ae76c9 100644
--- a/lib/File/Path.pm
+++ b/lib/File/Path.pm
@@ -6,8 +6,8 @@ File::Path - Create or remove directory trees
 
 =head1 VERSION
 
-This document describes version 2.00_02 of File::Path, released
-2007-06-06.
+This document describes version 2.00_03 of File::Path, released
+2007-06-07.
 
 =head1 SYNOPSIS
 
@@ -371,7 +371,7 @@ BEGIN {
 
 use Exporter ();
 use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '2.00_02';
+$VERSION = '2.00_03';
 @ISA     = qw(Exporter);
 @EXPORT  = qw(mkpath rmtree);
 
@@ -396,8 +396,11 @@ sub _croak {
 sub mkpath {
     my $new_style = (
         UNIVERSAL::isa($_[0],'ARRAY')
-        or (@_ == 2 and $_[1] =~ /\A\d+\z/)
-        or (@_ == 3 and $_[1] =~ /\A\d+\z/ and $_[2] =~ /\A\d+\z/)
+        or (@_ == 2 and (defined $_[1] ? $_[1] =~ /\A\d+\z/ : 1))
+        or (@_ == 3
+            and (defined $_[1] ? $_[1] =~ /\A\d+\z/ : 1)
+            and (defined $_[2] ? $_[2] =~ /\A\d+\z/ : 1)
+        )
     ) ? 0 : 1;
 
     my $arg;
@@ -470,8 +473,11 @@ sub _mkpath {
 sub rmtree {
     my $new_style = (
         UNIVERSAL::isa($_[0],'ARRAY')
-        or (@_ == 2 and $_[1] =~ /\A\d+\z/)
-        or (@_ == 3 and $_[1] =~ /\A\d+\z/ and $_[2] =~ /\A\d+\z/)
+        or (@_ == 2 and (defined $_[1] ? $_[1] =~ /\A\d+\z/ : 1))
+        or (@_ == 3
+            and (defined $_[1] ? $_[1] =~ /\A\d+\z/ : 1)
+            and (defined $_[2] ? $_[2] =~ /\A\d+\z/ : 1)
+        )
     ) ? 0 : 1;
 
     my $arg;