sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit c9908fa8636231b81155574c1a5a5c4af4e7e56d
parent 004f605412f27ae6d2acd813bd060b50d7203bc6
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Mon, 18 Feb 2008 06:00:47 -0800

remove requirement that space follows the colon in header parsing

Diffstat:
M lib/sup/mbox.rb | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
@@ -20,26 +20,26 @@ module MBox
     ## when scanning over large mbox files.
     while(line = f.gets)
       case line
-      when /^(From):\s+(.*?)\s*$/i,
-        /^(To):\s+(.*?)\s*$/i,
-        /^(Cc):\s+(.*?)\s*$/i,
-        /^(Bcc):\s+(.*?)\s*$/i,
-        /^(Subject):\s+(.*?)\s*$/i,
-        /^(Date):\s+(.*?)\s*$/i,
-        /^(References):\s+(.*?)\s*$/i,
-        /^(In-Reply-To):\s+(.*?)\s*$/i,
-        /^(Reply-To):\s+(.*?)\s*$/i,
-        /^(List-Post):\s+(.*?)\s*$/i,
-        /^(List-Subscribe):\s+(.*?)\s*$/i,
-        /^(List-Unsubscribe):\s+(.*?)\s*$/i,
-        /^(Status):\s+(.*?)\s*$/i: header[last = $1] = $2
-      when /^(Message-Id):\s+(.*?)\s*$/i: header[mid_field = last = $1] = $2
+      when /^(From):\s*(.*?)\s*$/i,
+        /^(To):\s*(.*?)\s*$/i,
+        /^(Cc):\s*(.*?)\s*$/i,
+        /^(Bcc):\s*(.*?)\s*$/i,
+        /^(Subject):\s*(.*?)\s*$/i,
+        /^(Date):\s*(.*?)\s*$/i,
+        /^(References):\s*(.*?)\s*$/i,
+        /^(In-Reply-To):\s*(.*?)\s*$/i,
+        /^(Reply-To):\s*(.*?)\s*$/i,
+        /^(List-Post):\s*(.*?)\s*$/i,
+        /^(List-Subscribe):\s*(.*?)\s*$/i,
+        /^(List-Unsubscribe):\s*(.*?)\s*$/i,
+        /^(Status):\s*(.*?)\s*$/i: header[last = $1] = $2
+      when /^(Message-Id):\s*(.*?)\s*$/i: header[mid_field = last = $1] = $2
 
       ## these next three can occur multiple times, and we want the
       ## first one
-      when /^(Delivered-To):\s+(.*)$/i,
-        /^(X-Original-To):\s+(.*)$/i,
-        /^(Envelope-To):\s+(.*)$/i: header[last = $1] ||= $2
+      when /^(Delivered-To):\s*(.*)$/i,
+        /^(X-Original-To):\s*(.*)$/i,
+        /^(Envelope-To):\s*(.*)$/i: header[last = $1] ||= $2
 
       when /^$/: break
       when /^\S+: /: last = nil # some other header we don't care about