From: Robin Barker Date: Wed, 9 Jun 2004 12:02:01 +0000 (+0100) Subject: Re: [perl #24081] invalid regexp in perl -V X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c6e7072ba51b7173484f5077541fbae1a031af0;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #24081] invalid regexp in perl -V Message-ID: <533D273D4014D411AB1D00062938C4D9040468F1@hotel.npl.co.uk> with further adjustements for bleadperl p4raw-id: //depot/perl@22921 --- diff --git a/configpm b/configpm index 4f301c3..e27996f 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 c32571c..26be975 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 $@;