[Xfce4-commits] <postler:master> Accumulate headers spanning over multiple lines

Christian Dywan noreply at xfce.org
Sun May 30 05:34:03 CEST 2010


Updating branch refs/heads/master
         to 9c8fdfa5203a536d55839b8041c80284eae2c74c (commit)
       from 5233fc5d8591e625eecbd17caa97cf9bb9eb22ab (commit)

commit 9c8fdfa5203a536d55839b8041c80284eae2c74c
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun May 30 05:20:59 2010 +0200

    Accumulate headers spanning over multiple lines

 postler/postler-content.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 3f8e1e5..ebdb40a 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -181,12 +181,22 @@ public class Postler.Content : WebKit.WebView {
             string organization = "";
             string x_mailer = "";
             /* Skip the header */
+            string previous_line = "";
             while ((line = stream.read_line (null, null)) != null) {
                 if (line == "")
                     break;
+                if (line.has_suffix (",") || line.has_suffix (";")) {
+                    previous_line += line;
+                    continue;
+                }
+                if (previous_line != "") {
+                    line = previous_line + line;
+                    previous_line = "";
+                }
                 parts = line.split (":", 2);
                 if (parts == null || parts[0] == null)
                     continue;
+
                 string field = parts[0].down ();
                 if (field == "content-type")
                     content_type = parts[1].strip ();



More information about the Xfce4-commits mailing list