sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit f2d046abf3cfc452143b7ef2fb0ad533cb191a64
parent b903a277872b175196508a6f1f0e871b56df9651
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Fri,  4 May 2007 06:33:26 +0000

handle trailing spaces in message headers (doh\!)

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@391 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/mbox.rb | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
@@ -16,24 +16,24 @@ module MBox
     ## when scanning over large mbox files.
     while(line = f.gets)
       case line
-      when /^(From):\s+(.*)$/i,
-        /^(To):\s+(.*)$/i,
-        /^(Cc):\s+(.*)$/i,
-        /^(Bcc):\s+(.*)$/i,
-        /^(Subject):\s+(.*)$/i,
-        /^(Date):\s+(.*)$/i,
-        /^(Message-Id):\s+<(.*)>$/i,
-        /^(References):\s+(.*)$/i,
-        /^(In-Reply-To):\s+(.*)$/i,
-        /^(Reply-To):\s+(.*)$/i,
-        /^(List-Post):\s+(.*)$/i,
-        /^(Status):\s+(.*)$/i: header[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,
+        /^(Message-Id):\s+<(.*)>\s*$/i,
+        /^(References):\s+(.*)\s*$/i,
+        /^(In-Reply-To):\s+(.*)\s*$/i,
+        /^(Reply-To):\s+(.*)\s*$/i,
+        /^(List-Post):\s+(.*)\s*$/i,
+        /^(Status):\s+(.*)\s*$/i: header[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.downcase] ||= $2
+        /^(Envelope-To):\s+(.*)$/i: header[last = $1] ||= $2
 
       when /^$/: break
       when /:/: last = nil