From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3BF7E1F487 for ; Sat, 4 Apr 2020 23:51:41 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] xt/msgtime_cmp: fix false positives from msgtime change Date: Sat, 4 Apr 2020 23:51:41 +0000 Message-Id: <20200404235141.17461-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: commit d857e7dc0d816b635a7ead09c3273f8c2d2434be ("msgtime: assume +0000 if TZ missing when using Date::Parse") introduced a behavior change which was causes false positives when compared to the old code. Update the "old" implementation to match this overdue behavior change. --- xt/msgtime_cmp.t | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xt/msgtime_cmp.t b/xt/msgtime_cmp.t index b77e57a6..4ebf5b2c 100644 --- a/xt/msgtime_cmp.t +++ b/xt/msgtime_cmp.t @@ -82,6 +82,13 @@ sub str2date_zone ($) { # off is the time zone offset in seconds from GMT my ($ss,$mm,$hh,$day,$month,$year,$off) = Date::Parse::strptime($date); + + # new behavior which wasn't in the original old version: + if ('commit d857e7dc0d816b635a7ead09c3273f8c2d2434be') { + # "msgtime: assume +0000 if TZ missing when using Date::Parse" + $off //= '+0000'; + } + return undef unless(defined $off); # Compute the time zone from offset