summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigpm2
-rw-r--r--lib/Config.t9
2 files changed, 9 insertions, 2 deletions
diff --git a/configpm b/configpm
index 4f301c38fa..e27996f82b 100755
--- a/configpm
+++ b/configpm
@@ -329,7 +329,7 @@ sub config_sh {
sub config_re {
my $re = shift;
- return map { chomp; $_ } grep /^$re=/, split /^/, $Config_SH;
+ return map { chomp; $_ } grep eval{ /^(?:$re)=/ }, split /^/, $Config_SH;
}
sub config_vars {
diff --git a/lib/Config.t b/lib/Config.t
index c32571c51b..26be9751bd 100644
--- a/lib/Config.t
+++ b/lib/Config.t
@@ -6,7 +6,7 @@ BEGIN {
require "./test.pl";
}
-plan tests => 46;
+plan tests => 47;
use_ok('Config');
@@ -89,6 +89,10 @@ Config::config_vars(':PERL_API_REVISION:');
my $out5 = $$out;
$out->clear;
+Config::config_vars('?flags');
+my $out6 = $$out;
+$out->clear;
+
untie *STDOUT;
like($out1, qr/^cc='\Q$Config{cc}\E';/, "config_vars cc");
like($out2, qr/^d_bork='UNKNOWN';/, "config_vars d_bork is UNKNOWN");
@@ -106,6 +110,9 @@ is("'9'", $api[2], "version is 9");
is("'1'", $api[1], "subversion is 1");
is("'5' ", $out5, "leading and trailing colons return just the value");
+
+like($out6, qr/\bnot\s+found\b/, "config_vars with invalid regexp");
+
# Read-only.
undef $@;