Fix for bug 84054. Appledouble files weren't correctly detected and AppleSingle weren't correctly generated if they don't have a datafork. R=varada, SR=bienvenu, A=chofmann

This commit is contained in:
ducarroz%netscape.com 2001-06-05 04:50:10 +00:00
Родитель 90cb8dbf91
Коммит 3ddf96bad8
2 изменённых файлов: 5 добавлений и 5 удалений

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

@ -87,8 +87,7 @@ NS_IMETHODIMP nsDecodeAppleFile::Close(void)
/* Check if the file is complete and if it's the case, write file attributes */
if (m_headerOk)
{
PRBool dataOk = PR_FALSE;
PRBool resourceOk = PR_FALSE;
PRBool dataOk = PR_TRUE; /* It's ok if the file doesn't have a datafork, therefore set it to true by default. */
if (m_headers.magic == APPLESINGLE_MAGIC)
{
for (i = 0; i < m_headers.entriesCount; i ++)
@ -98,9 +97,8 @@ NS_IMETHODIMP nsDecodeAppleFile::Close(void)
break;
}
}
else
dataOk = PR_TRUE;
PRBool resourceOk = FALSE;
for (i = 0; i < m_headers.entriesCount; i ++)
if (ENT_RFORK == m_entries[i].id)
{

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

@ -797,7 +797,9 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
#ifdef XP_MAC
nsXPIDLCString contentType;
mMimeInfo->GetMIMEType(getter_Copies(contentType));
if (contentType && !nsCRT::strcasecmp(contentType, APPLICATION_APPLEFILE))
if (contentType &&
(nsCRT::strcasecmp(contentType, APPLICATION_APPLEFILE) == 0) ||
(nsCRT::strcasecmp(contentType, MULTIPART_APPLEDOUBLE) == 0))
{
nsCOMPtr<nsIOutputStream> appleFileDecoder;
NS_NEWXPCOM(appleFileDecoder, nsDecodeAppleFile);