зеркало из https://github.com/mozilla/pjs.git
Bug #73093 --> fix corruption when opening attachments multiple times. When determining if
we are fetching a part look for ;section= AND ?section= in the url spec. sr=bienvenu
This commit is contained in:
Родитель
c75ad76702
Коммит
62ed722064
|
@ -362,16 +362,20 @@ NS_IMETHODIMP nsImapUrl::CreateListOfMessageIdsString(char ** aResult)
|
|||
|
||||
NS_IMETHODIMP nsImapUrl::GetImapPartToFetch(char **result)
|
||||
{
|
||||
// here's the old code:
|
||||
char *wherepart = NULL;
|
||||
if (m_listOfMessageIds && (wherepart = PL_strstr(m_listOfMessageIds, "/;section=")) != NULL)
|
||||
// here's the old code....
|
||||
|
||||
// unforunately an imap part can have the form: /;section= OR
|
||||
// it can have the form ?section=. We need to look for both.
|
||||
if (m_listOfMessageIds)
|
||||
{
|
||||
wherepart += 10; // nsCRT::strlen("/;section=")
|
||||
char *wherepart = PL_strstr(m_listOfMessageIds, ";section=");
|
||||
if (!wherepart) // look for ?section too....
|
||||
wherepart = PL_strstr(m_listOfMessageIds, "?section=");
|
||||
if (wherepart)
|
||||
{
|
||||
wherepart += 9; // nsCRT::strlen("/;section=")
|
||||
char *wherelibmimepart = PL_strstr(wherepart, "&part=");
|
||||
int numCharsToCopy = (wherelibmimepart) ?
|
||||
wherelibmimepart - wherepart :
|
||||
int numCharsToCopy = (wherelibmimepart) ? wherelibmimepart - wherepart :
|
||||
PL_strlen(m_listOfMessageIds) - (wherepart - m_listOfMessageIds);
|
||||
if (numCharsToCopy)
|
||||
{
|
||||
|
@ -382,8 +386,8 @@ NS_IMETHODIMP nsImapUrl::GetImapPartToFetch(char **result)
|
|||
(*result)[numCharsToCopy] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // if we got a wherepart
|
||||
} // if we got a m_listOfMessageIds
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче