diff options
author | Matthew Horsfall (alh) <wolfsage@gmail.com> | 2011-07-31 22:42:22 -0400 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-02 14:32:10 -0700 |
commit | e958e573604ab75ea497030026663063af7f21a6 (patch) | |
tree | 99fd8d43881b71c5c6593ff449331e1ea42be9d1 /lib/diagnostics.pm | |
parent | 706c19b7f8e3507cf277370f033ddc7c57499fdf (diff) | |
download | perl-e958e573604ab75ea497030026663063af7f21a6.tar.gz |
RT #94988 - Support for %u in diagnostics.pm's printf()-format parser
Diffstat (limited to 'lib/diagnostics.pm')
-rw-r--r-- | lib/diagnostics.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index f2d542927a..60c96ea3ce 100644 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -410,22 +410,22 @@ my %msg; # Since we strip "\.\n" when we search a warning, strip it here as well $header =~ s/\.?$//; - my @toks = split( /(%l?[dx]|%c|%(?:\.\d+)?[fs])/, $header ); + my @toks = split( /(%l?[dx]|%u|%c|%(?:\.\d+)?[fs])/, $header ); if (@toks > 1) { my $conlen = 0; for my $i (0..$#toks){ if( $i % 2 ){ if( $toks[$i] eq '%c' ){ $toks[$i] = '.'; - } elsif( $toks[$i] eq '%d' ){ + } elsif( $toks[$i] =~ /^%(?:d|u)$/ ){ $toks[$i] = '\d+'; } elsif( $toks[$i] =~ '^%(?:s|.*f)$' ){ $toks[$i] = $i == $#toks ? '.*' : '.*?'; } elsif( $toks[$i] =~ '%.(\d+)s' ){ $toks[$i] = ".{$1}"; - } elsif( $toks[$i] =~ '^%l*x$' ){ + } elsif( $toks[$i] =~ '^%l*x$' ){ $toks[$i] = '[\da-f]+'; - } + } } elsif( length( $toks[$i] ) ){ $toks[$i] = quotemeta $toks[$i]; $conlen += length( $toks[$i] ); |