unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] xt/msgtime_cmp: fix false positives from msgtime change
@ 2020-04-04 23:51 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-04-04 23:51 UTC (permalink / raw)
  To: meta

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-04 23:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-04 23:51 [PATCH] xt/msgtime_cmp: fix false positives from msgtime change Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).