Skip to content

Commit 63ddec5

Browse files
committed
Fix problems with 65a7878 on v5.10.x
1 parent 65a7878 commit 63ddec5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3019,7 +3019,8 @@ sub parse_version {
30193019
$result = $normal if defined $normal;
30203020
}
30213021
if ( defined $result ) {
3022-
$result = "undef" unless $result =~ m!^[\d_\.\-]+$! or eval { version->parse( $result ) };
3022+
$result = "undef" unless $result =~ m!^v?[\d_\.\-]+$!
3023+
or eval { version->parse( $result ) };
30233024
}
30243025
$result = "undef" unless defined $result;
30253026
return $result;

t/parse_version.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ my %versions = (q[$VERSION = '1.00'] => '1.00',
4444
'$VERSION = substr(q$Revision: 2.8 $, 10) + 2 . "";' => '4.8',
4545
q[our $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };] => '2.07', # Fucking seriously?
4646
'elsif ( $Something::VERSION >= 1.99 )' => undef,
47-
q[our $VERSION = "1.00 / the fucking fuck";] => 'undef',
4847
);
4948

5049
if( $Has_Version ) {
@@ -65,6 +64,7 @@ if( "$]" >= 5.011001 ) {
6564
$versions{'package Foo 1.23_01;' } = '1.23_01';
6665
$versions{'package Foo v1.23_01;' } = 'v1.23_01';
6766
$versions{q["package Foo 1.23"]} = undef;
67+
$versions{q[our $VERSION = "1.00 / the fucking fuck";]} = 'undef';
6868
$versions{<<'END'} = '1.23';
6969
package Foo 1.23;
7070
our $VERSION = 2.34;

0 commit comments

Comments
 (0)