about summary refs log tree commit homepage
path: root/xt
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-04 23:51:41 +0000
committerEric Wong <e@yhbt.net>2020-04-05 07:25:11 +0000
commitb6fc8916a05176ef006b07bba977b59cdf6a0bce (patch)
treeed28c59069531fbf443ea5c3b9b1a30527251149 /xt
parent6ebcec3add4d6aeff6e3b3eb019a404528c079ec (diff)
downloadpublic-inbox-b6fc8916a05176ef006b07bba977b59cdf6a0bce.tar.gz
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.
Diffstat (limited to 'xt')
-rw-r--r--xt/msgtime_cmp.t7
1 files changed, 7 insertions, 0 deletions
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