fix comma handling when breaking up long imap fetch statements, initial patch by lee.essen@db.com, r/sr=bienvenu

This commit is contained in:
bienvenu%nventure.com 2004-03-04 19:39:36 +00:00
Родитель 9d5f416cab
Коммит ca4f1bb3dc
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -428,8 +428,6 @@ void AllocateImapUidString(PRUint32 *msgUids, PRUint32 &msgCount,
returnString.AppendInt(startSequence);
returnString += ':';
returnString.AppendInt(curSequenceEnd);
if (!lastKey)
returnString += ',';
startSequence = nextKey;
curSequenceEnd = startSequence;
curFlagStateIndex = -1;
@ -439,8 +437,6 @@ void AllocateImapUidString(PRUint32 *msgUids, PRUint32 &msgCount,
startSequence = nextKey;
curSequenceEnd = startSequence;
returnString.AppendInt(msgUids[keyIndex]);
if (!lastKey)
returnString += ',';
curFlagStateIndex = -1;
}
// check if we've generated too long a string - if there's no flag state,
@ -451,6 +447,10 @@ void AllocateImapUidString(PRUint32 *msgUids, PRUint32 &msgCount,
msgCount = total;
break;
}
// If we are not the last item then we need to add the comma
// but it's important we do it here, after the length check
if (!lastKey)
returnString += ',';
}
}