Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: cberry [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] make File::Spec::VMS::splitdir return empty array on empty or undefined input
Hmm. Looks like I just missed a release by a few days. This was reported on vmsperl some time ago and I've finally gotten around to doing something about it. When splitdir is passed an empty string or undef, it returns an empty scalar on VMS, as opposed to an empty array on all other platforms. It seems like we ought to do what everybody else does. The attached patch gets us in sync.
Subject: splitdir_undef_return.patch.txt
--- lib/File/Spec/VMS.pm;-0 Tue Jun 13 14:29:14 2006 +++ lib/File/Spec/VMS.pm Mon May 28 17:08:49 2007 @@ -260,6 +260,8 @@ Split dirspec using VMS syntax. sub splitdir { my($self,$dirspec) = @_; + my @dirs = (); + return @dirs if ( (!defined $dirspec) || ('' eq $dirspec) ); $dirspec =~ tr/<>/[]/; # < and > ==> [ and ] $dirspec =~ s/\]\[\./\.\]\[/g; # ][. ==> .][ $dirspec =~ s/\[000000\.\]\[/\[/g; # [000000.][ ==> [ @@ -274,7 +276,7 @@ sub splitdir { # .--] ==> .-.-] # [--] ==> [-.-] $dirspec = "[$dirspec]" unless $dirspec =~ /[\[<]/; # make legal - my(@dirs) = split('\.', vmspath($dirspec)); + @dirs = split('\.', vmspath($dirspec)); $dirs[0] =~ s/^[\[<]//s; $dirs[-1] =~ s/[\]>]\Z(?!\n)//s; @dirs; }
Thanks, Craig. I added a test to t/crossplatform.t to confirm the patch, and it looks like the same problem was happening on MacOS so I fixed it there too. -Ken
Subject: Re: [rt.cpan.org #27362] [PATCH] make File::Spec::VMS::splitdir return empty array on empty or undefined input
Date: Thu, 31 May 2007 21:44:24 -0500
To: Ken_Williams via RT <bug-PathTools [...] rt.cpan.org>
From: "Craig A. Berry" <craigberry [...] mac.com>
Wow, that was fast, thanks. Show quoted text
><URL: http://rt.cpan.org/Ticket/Display.html?id=27362 > > >Thanks, Craig. I added a test to t/crossplatform.t to confirm the patch, and it looks like the >same problem was happening on MacOS so I fixed it there too. > > -Ken
-- Show quoted text
________________________________________ Craig A. Berry mailto:craigberry@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser