diff --git a/uriloader/exthandler/mac/nsInternetConfigService.cpp b/uriloader/exthandler/mac/nsInternetConfigService.cpp index 60fb049bc52..1d3eab321e8 100644 --- a/uriloader/exthandler/mac/nsInternetConfigService.cpp +++ b/uriloader/exthandler/mac/nsInternetConfigService.cpp @@ -477,8 +477,23 @@ NS_IMETHODIMP nsInternetConfigService::GetDownloadFolder(FSSpec *fsspec) { rv = NS_OK; } + else + { // ResolveAlias for the DownloadFolder failed - try grabbing the FSSpec + err = ::ICFindPrefHandle(inst, kICDownloadFolder, &attr, prefH); + if (err == noErr) + { // Use FSMakeFSSpec to verify the saved FSSpec is still valid + err = ::FSMakeFSSpec((*(ICFileSpecHandle)prefH)->fss.vRefNum, + (*(ICFileSpecHandle)prefH)->fss.parID, + (*(ICFileSpecHandle)prefH)->fss.name, + fsspec); + if (err == noErr) + rv = NS_OK; + } + } } } + // Best not to leave that handle laying around + DisposeHandle(prefH); } err = ::ICEnd(inst); } diff --git a/xpfe/appshell/src/nsInternetConfigService.cpp b/xpfe/appshell/src/nsInternetConfigService.cpp index 60fb049bc52..1d3eab321e8 100644 --- a/xpfe/appshell/src/nsInternetConfigService.cpp +++ b/xpfe/appshell/src/nsInternetConfigService.cpp @@ -477,8 +477,23 @@ NS_IMETHODIMP nsInternetConfigService::GetDownloadFolder(FSSpec *fsspec) { rv = NS_OK; } + else + { // ResolveAlias for the DownloadFolder failed - try grabbing the FSSpec + err = ::ICFindPrefHandle(inst, kICDownloadFolder, &attr, prefH); + if (err == noErr) + { // Use FSMakeFSSpec to verify the saved FSSpec is still valid + err = ::FSMakeFSSpec((*(ICFileSpecHandle)prefH)->fss.vRefNum, + (*(ICFileSpecHandle)prefH)->fss.parID, + (*(ICFileSpecHandle)prefH)->fss.name, + fsspec); + if (err == noErr) + rv = NS_OK; + } + } } } + // Best not to leave that handle laying around + DisposeHandle(prefH); } err = ::ICEnd(inst); }