[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim/libkmime
From:       Tom Albers <tomalbers () kde ! nl>
Date:       2007-01-22 20:19:11
Message-ID: 1169497151.543988.9264.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 626312 by toma:

Backport of trunk commit 626306 by vkrause:
more tolerant parsing of broken headers


 M  +4 -1      kmime_util.cpp  


--- branches/KDE/3.5/kdepim/libkmime/kmime_util.cpp #626311:626312
@@ -360,7 +360,7 @@
 
 QCString extractHeader(const QCString &src, const char *name)
 {
-  QCString n=QCString(name)+": ";
+  QCString n=QCString(name)+":";
   int pos1=-1, pos2=0, len=src.length()-1;
   bool folded(false);
 
@@ -373,6 +373,9 @@
 
   if (pos1>-1) {    //there is a header with the given name
     pos1+=n.length(); //skip the name
+    // skip the usual space after the colon
+    if ( src.at( pos1 ) == ' ' )
+      ++pos1;
     pos2=pos1;
 
     if (src[pos2]!='\n') {  // check if the header is not empty
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic