ExtUtils::Embed::canon needs to *globally* substitute / for $as
authorNicholas Clark <nick@ccl4.org>
Mon, 15 Jul 2013 14:58:08 +0000 (16:58 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 15 Jul 2013 14:58:08 +0000 (16:58 +0200)
Otherwise the results are buggy for package names with two or more separators.
This bug broke a -Uusedl build, once ExtUtils::Embed was refactored to use
the existing but always-buggy functionality.

lib/ExtUtils/Embed.pm
pod/perldelta.pod

index 0e3cbbe..05925cf 100644 (file)
@@ -271,7 +271,7 @@ sub canon {
         s!/\w+\.\w+$!!;
     }
     if ($as ne '/') {
-        s!/!$as!
+        s!/!$as!g
             foreach @ext;
     }
     @ext;
index 24eebb9..e33c001 100644 (file)
@@ -142,6 +142,12 @@ happen to have local and incompatible files named F<EXTERN.h>, F<XSUB.h> or
 F<perl.h>, as these will now be picked up instead of the installed Perl
 headers.
 
+The C<canon()> function now correctly handles packages with multiple C<::>
+separators when the I<$as> parameter is not I</>. Given that it used to
+generate strings which would likely be syntax errors or pathnames instead of
+filenames, we infer that from the complete lack of bug reports no-one was
+using this functionality. (C<ExtUtils::Miniperl> is now using it.)
+
 =item *
 
 L<ExtUtils::Miniperl> has been upgraded and given a version of 1.