rem: if (oldIndent.isNull())
add: if (firstPart)
context: static void smartQuote( QString &msg, const QString &ownIndent, int maxLength ){  QStringList part;  QString startOfSig1;  QString startOfSig2 = ownIndent+"--";  QString oldIndent;  int i = 0;  int l = 0;  while( startOfSig2.left(1) == "\n")      startOfSig2 = startOfSig2.mid(1);  startOfSig1 = startOfSig2 + ' ';  QStringList lines;  while ((i = msg.find('\n', l)) != -1)  {     if (i == l)        lines.append( QString::null);     else        lines.append( msg.mid(l, i-l));     l = i+1;  }  if (l <= (int) msg.length());     lines.append( msg.mid(l));  msg = QString::null;  for(QStringList::Iterator it = lines.begin();      it != lines.end();      it++)  {     QString line = *it;     if (line == startOfSig1) break; // Start of signature      if (line == startOfSig2) break; // Start of malformed signature      QString indent = splitLine( line );//     printf("Quoted Line = \"%s\" \"%s\"\n", line.ascii(), indent.ascii());     if ( line.isEmpty())      {        if (!oldIndent.isEmpty())           part.append(QString::null);        continue;     };      if (oldIndent.isNull())     {        oldIndent = indent;     }     if (oldIndent != indent)     {        QString fromLine;        // Search if the last non-blank line could be "From" line        if (part.count() && (oldIndent.length() < indent.length()))        {           QStringList::Iterator it2 = part.fromLast();           while( (it2 != part.end()) && (*it2).isEmpty())             it2--;           if ((it2 != part.end()) && ((*it2).right(1) == ":"))           {              fromLine = oldIndent + (*it2) + "\n";              part.remove(it2);           }        }        if (flushPart( msg, part, oldIndent, maxLength))        {           if (oldIndent.length() > indent.length())              msg += indent + "\n";           else              msg += oldIndent + "\n";          }        if (!fromLine.isEmpty())        {           msg += fromLine;//printf("From = %s", fromLine.ascii());        }        oldIndent = indent;     }     part.append(line);  }  flushPart( msg, part, oldIndent, maxLength);}