Fix the "\nFrom " mbox problem in an IMHO correct way.

svn path=/trunk/kdenetwork/kmail/; revision=76446
wilder-work
Michael Haeckel 26 years ago
parent 36e3ae7e89
commit da0aef4d81
  1. 1
      kmfolder.cpp
  2. 3
      kmmessage.cpp

@ -1042,6 +1042,7 @@ int KMFolder::addMsg(KMMessage* aMsg, int* aIndex_ret)
aMsg->setStatusFields();
msgText = aMsg->asString();
msgText.replace(QRegExp("\nFrom "),"\n>From ");
len = msgText.length();
assert(mStream != NULL);

@ -254,7 +254,8 @@ void KMMessage::fromString(const QString& aStr, bool aSetStatus)
resultPos = (char*)result.data();
if (strPos) for (; (ch=*strPos)!='\0'; strPos++)
{
if (ch>=' ' || ch=='\t' || ch=='\n' || ch<='\0')
if ((ch>=' ' || ch=='\t' || ch=='\n' || ch<='\0')
&& !(ch=='>' && aStr.mid(strPos-aStr.data()-1,6)=="\n>From"))
*resultPos++ = ch;
}
*resultPos = '\0'; // terminate zero for casting

Loading…
Cancel
Save