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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1180652078-7617-2"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 397
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
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1180652077-7617-1"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: text/plain; charset="utf-8"; name="splitdir_undef_return.patch.txt"
Content-Disposition: inline; filename="splitdir_undef_return.patch.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 781
--- 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; }
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-7640-1180664740-1114.27362-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 165
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
MIME-Version: 1.0
X-Spam-Status: No, hits=-4.6 required=8.0 tests=BAYES_00,DKIM_POLICY_SIGNSOME,DK_POLICY_SIGNSOME,KARMA_CONNECT_POSITIVE,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-7640-1180664740-1114.27362-6-0 [...] rt.cpan.org>
Received-SPF: pass (x1.develooper.com: local policy)
References: <RT-Ticket-27362 [...] rt.cpan.org> <rt-3.6.HEAD-7640-1180664740-1114.27362-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: us-ascii
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id E6BC94D80A2 for <bug-PathTools [...] rt.cpan.org>; Thu, 31 May 2007 22:50:05 -0400 (EDT)
Received: (qmail 16482 invoked by alias); 1 Jun 2007 02:50:05 -0000
Received: from smtpout.mac.com (HELO smtpout.mac.com) (17.250.248.184) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 31 May 2007 19:49:31 -0700
Received: from mac.com (smtpin01-en2 [10.13.10.146]) by smtpout.mac.com (Xserve/smtpout14/MantshX 4.0) with ESMTP id l512nRHQ000424 for <bug-PathTools [...] rt.cpan.org>; Thu, 31 May 2007 19:49:27 -0700 (PDT)
Received: from [172.16.52.1] (dsl081-145-238.chi1.dsl.speakeasy.net [64.81.145.238]) (authenticated bits=0) by mac.com (Xserve/smtpin01/MantshX 4.0) with ESMTP id l512n8s3009860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-PathTools [...] rt.cpan.org>; Thu, 31 May 2007 19:49:16 -0700 (PDT)
Delivered-To: cpan-bug+pathtools [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #27362] [PATCH] make File::Spec::VMS::splitdir return empty array on empty or undefined input
Return-Path: <craigberry [...] mac.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-PathTools [...] rt.cpan.org
X-Brightmail-Scanned: yes
X-Brightmail-Tracker: AAAAAA==
Date: Thu, 31 May 2007 21:44:24 -0500
Message-Id: <p06240802c285386fb544 [...] [172.16.52.1]>
To: Ken_Williams via RT <bug-PathTools [...] rt.cpan.org>
From: "Craig A. Berry" <craigberry [...] mac.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-7654-1180666210-1960.27362-0-0 [...] rt.cpan.org>
Content-Length: 449
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.