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)

Attachments


Subject: [PATCH] make File::Spec::VMS::splitdir return empty array on empty or undefined input
Download (untitled) / with headers
text/plain 397b
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; }
Download (untitled) / with headers
text/plain 165b
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>
Download (untitled) / with headers
text/plain 449b
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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.