commit 4255437a5b252c7268c7ec2743b182982334ccb5
parent 6227c9ed977e0c88c9a499cccca4c1383ee2f3bb
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 12 May 2024 14:02:57 +1000
use Time.strptime when parsing mbox From lines
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
@@ -179,8 +179,7 @@ class MBox < Source
l =~ BREAK_RE or return false
time = $1
begin
- ## hack -- make Time.parse fail when trying to substitute values from Time.now
- Time.parse time, Time.at(0)
+ Time.strptime time, "%a %b %d %H:%M:%S %Y"
true
rescue NoMethodError, ArgumentError
warn "found invalid date in potential mbox split line, not splitting: #{l.inspect}"