Skip to content

Commit 8f93839

Browse files
committed
Errno: also escape osvers
Partly fixes #21135 Tested by Configuring with ... -Darchname='x86_64-linux@alpha' -Dosvers='4.19.0@beta'
1 parent 5d7d794 commit 8f93839

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/Errno/Errno_pm.PL

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
22
use Config;
33
use strict;
44

5-
our $VERSION = "1.37";
5+
our $VERSION = "1.38";
66

77
my %err = ();
88

@@ -271,9 +271,9 @@ sub write_errno_pm {
271271
close(CPPO);
272272
}
273273

274-
# escape $Config{'archname'}
275-
my $archname = $Config{'archname'};
276-
$archname =~ s/([@%\$])/\\$1/g;
274+
# escape $Config{'archname'}, $Config{'osvers'}
275+
my ($archname, $osvers) = @Config{'archname', 'osvers'};
276+
$_ = quotemeta for $archname, $osvers;
277277

278278
# Write Errno.pm
279279

@@ -297,8 +297,8 @@ EDQ
297297
print <<"CONFIG_CHECK_END";
298298
use Config;
299299
"\$Config{'archname'}-\$Config{'osvers'}" eq
300-
"$archname-$Config{'osvers'}" or
301-
die "Errno architecture ($archname-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
300+
"$archname-$osvers" or
301+
die "Errno architecture ($archname-$osvers) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
302302
303303
CONFIG_CHECK_END
304304
}

0 commit comments

Comments
 (0)