summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2013-03-18 09:53:52 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2013-03-18 09:53:52 +0000
commit746bdb56f289097c199c483025cc5427febae81e (patch)
tree584df71a445da1eead3f2bc702e60110410a0561
parent4508ebf108b85b737b637cd72a39a424f0e86bc8 (diff)
Handle case of no Received lines better
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@593 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xawm5
1 files changed, 3 insertions, 2 deletions
diff --git a/awm b/awm
index 0f89936..8166509 100755
--- a/awm
+++ b/awm
@@ -139,8 +139,9 @@ sub gettime($) {
my $mail = new Mail::Internet($maillines);
my $header = $mail->head();
my $received = $header->get('Received', 0);
- my ($date) = $received =~ /;([^;]+)$/ if defined $received;
- my $time = parsedate($date) if defined $date;
+ my ($date, $time);
+ ($date) = $received =~ /;([^;]+)$/ if defined $received;
+ $time = parsedate($date) if defined $date;
unless (defined $time) {
$QUIET or warn ("$PROGRAM_NAME: Falling back to date header in $file\n");
$date = $header->get('Date');