develooper Front page | perl.perl5.porters | Postings from March 2014

Re: [perl #121512] .pmc not loaded if @INC has a trailing slash

Thread Previous | Thread Next
From:
wolfsage
Date:
March 31, 2014 12:32
Subject:
Re: [perl #121512] .pmc not loaded if @INC has a trailing slash
Message ID:
CAJ0K8bieSYFtfr+qekUKvNkyB9L6C+a-fJd67ejYfdd+M00NUA@mail.gmail.com
On Sat, Mar 29, 2014 at 3:28 PM, Dave Mitchell <davem@iabyn.com> wrote:
> On Wed, Mar 26, 2014 at 03:23:06PM -0700, Michael G Schwern wrote:
>> If the @INC directory where a .pm and .pmc are located has a trailing
>> slash, require will fail to load the .pmc.  I suspect this bug was
>> added in eb70bb4a400e88a66c7e10414a2d52b5da4cfd1f
>
> A bisect comes up with this:
>
> commit 6b0bdd7f2041803dc3ec72b53d28052705861967
> Author:     Matthew Horsfall (alh) <wolfsage@gmail.com>
> AuthorDate: Thu Dec 27 10:38:08 2012 -0500
> Commit:     Father Chrysostomos <sprout@cpan.org>
> CommitDate: Sun Feb 10 12:19:15 2013 -0800
>
>     RT-116192 - If a directory in @INC already has a trailing '/', don't add another.

My apologies! Patch attached.

The original code always assumed a '/' would be appended, so it set
the length of the resulting SV to be +1.

With my earlier patch, this wasn't the case if the SV already ended in
a '/', so later checks on the SV that were based off the length of the
SV would be wrong.

New tests included.

-- Matthew Horsfall (alh)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About