X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=src%2Fsrc%2Fexigrep.src;h=1899267be74d048bef2d313f7b8fe9e876582787;hp=45bdc2c80cffe3bafc2f2cfa08773fc37b4e4b8a;hb=cab0c27721a3c1f3a146e44bcc6462eefb9eb9e7;hpb=0a27a8228d3ccf0730f54710781abb1185ed26b5 diff --git a/src/src/exigrep.src b/src/src/exigrep.src index 45bdc2c80..1899267be 100644 --- a/src/src/exigrep.src +++ b/src/src/exigrep.src @@ -45,7 +45,7 @@ use POSIX qw(mktime); sub seconds { my($year,$month,$day,$hour,$min,$sec,$tzs,$tzh,$tzm) = - $_[0] =~ /^(\d{4})-(\d\d)-(\d\d)\s(\d\d):(\d\d):(\d\d)(?>\s([+-])(\d\d)(\d\d))?/o; + $_[0] =~ /^(\d{4})-(\d\d)-(\d\d)\s(\d\d):(\d\d):(\d\d)(?:.\d+)?(?>\s([+-])(\d\d)(\d\d))?/o; my $seconds = mktime $sec, $min, $hour, $day, $month - 1, $year - 1900; @@ -83,7 +83,7 @@ sub do_line { if (!/^\d{4}-/o) { $_ =~ s/^.*? exim\b.*?: //o; } return unless - my($date,$id) = /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d (?:[+-]\d{4} )?)(?:\[\d+\] )?(\w{6}\-\w{6}\-\w{2})?/o; + my($date,$id) = /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? (?:[+-]\d{4} )?)(?:\[\d+\] )?(\w{6}\-\w{6}\-\w{2})?/o; # Handle the case when the log line belongs to a specific message. We save # lines for specific messages until the message is complete. Then either print @@ -124,7 +124,7 @@ if (defined $id) if (index($_, 'Completed') != -1 || index($_, 'SMTP data timeout') != -1 || (index($_, 'rejected') != -1 && - /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d (?:[+-]\d{4} )?)(?:\[\d+\] )?\w{6}\-\w{6}\-\w{2} rejected/o)) + /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? (?:[+-]\d{4} )?)(?:\[\d+\] )?\w{6}\-\w{6}\-\w{2} rejected/o)) { if ($queue_time != -1 && $saved{$id} =~ /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d ([+-]\d{4} )?)/o) @@ -239,11 +239,12 @@ if (-t 1 and $use_pager) { foreach ($ENV{PAGER}//(), 'less', 'more') { + local $ENV{LESS} .= ' --no-init --quit-if-one-screen'; open(my $pager, '|-', $_) or next; select $pager; last; } -} + } # If file arguments are given, open each one and process according as it is # is compressed or not.