Bug 62110 - initialize rv in nsLocalFile::SetPersistentDescriptor. Fixes multiple folders bug in mail on Mac OS X, and probably other bugs as well. r=pinkerton, sr=mscott, a=dbaron

This commit is contained in:
sfraser@netscape.com
2001-08-28 01:57:20 +00:00
parent 8c904a5646
commit 12f006147d

View File

@@ -677,7 +677,7 @@ static OSErr ResolvePathAndSpec(const char * filePath, FSSpec *inSpec, PRBool cr
else if ((err == fnfErr) && createDirs) else if ((err == fnfErr) && createDirs)
{ {
// If we got "file not found" and we're allowed to create directories // If we got "file not found" and we're allowed to create directories
// then we need to create aone // then we need to create one
err = ::FSpDirCreate(outSpec, smCurrentScript, &outSpec->parID); err = ::FSpDirCreate(outSpec, smCurrentScript, &outSpec->parID);
// For some reason, this usually returns fnfErr, even though it works. // For some reason, this usually returns fnfErr, even though it works.
if (err == fnfErr) if (err == fnfErr)
@@ -2319,7 +2319,7 @@ nsLocalFile::SetPersistentDescriptor(const char * aPersistentDescriptor)
{ {
NS_ENSURE_ARG(aPersistentDescriptor); NS_ENSURE_ARG(aPersistentDescriptor);
nsresult rv; nsresult rv = NS_OK;
PRUint32 dataSize = nsCRT::strlen(aPersistentDescriptor); PRUint32 dataSize = nsCRT::strlen(aPersistentDescriptor);
char* decodedData = PL_Base64Decode((const char*)aPersistentDescriptor, dataSize, nsnull); char* decodedData = PL_Base64Decode((const char*)aPersistentDescriptor, dataSize, nsnull);
@@ -2336,7 +2336,7 @@ nsLocalFile::SetPersistentDescriptor(const char * aPersistentDescriptor)
err = ::ResolveAlias(nsnull, aliasH, &resolvedSpec, &changed); err = ::ResolveAlias(nsnull, aliasH, &resolvedSpec, &changed);
if (err == fnfErr) // resolvedSpec is valid in this case if (err == fnfErr) // resolvedSpec is valid in this case
err = noErr; err = noErr;
rv = MacErrorMapper(err); rv = MacErrorMapper(err);
DisposeHandle((Handle) aliasH); DisposeHandle((Handle) aliasH);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);