Skip to content

Commit

Permalink
use Time.strptime when parsing mbox From lines
Browse files Browse the repository at this point in the history
  • Loading branch information
danc86 committed May 12, 2024
1 parent 6227c9e commit 4255437
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/sup/mbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def self.is_break_line? l
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}"
Expand Down

0 comments on commit 4255437

Please sign in to comment.