Bug 103658: if a filter rule contains an odd number of quotes, Mozilla is unable to parse it, patch by Guy Alfandary <galfandary@yahoo.ca>, r=mscott, sr=bienvenu

This commit is contained in:
gavin%gavinsharp.com 2006-11-06 15:55:52 +00:00
Родитель 6b83163ce7
Коммит a311dec489
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -535,6 +535,7 @@ nsresult nsMsgFilterList::LoadValue(nsCString &value, nsIOFileStream *aStream)
curChar = '"';
else if (nextChar == '\\') // replace "\\" with "\"
{
valueStr += curChar;
curChar = ReadChar(aStream);
}
else
@ -825,6 +826,12 @@ NS_IMETHODIMP nsMsgFilterList::ParseCondition(nsIMsgFilter *aFilter, const char
if (newTerm)
{
/* Invert nsMsgSearchTerm::EscapeQuotesInStr() */
for (char *to = termDup, *from = termDup;;)
{
if (*from == '\\' && from[1] == '"') from++;
if (!(*to++ = *from++)) break;
}
newTerm->m_booleanOp = (ANDTerm) ? nsMsgSearchBooleanOp::BooleanAND
: nsMsgSearchBooleanOp::BooleanOR;