mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Fix site selector failover url parsing and download redirect ini routine. (Both nsbeta2+ bugs.)
This commit is contained in:
parent
57f7cbb57a
commit
d5721f71b3
@ -282,6 +282,12 @@ DownloadRedirect(short vRefNum, long dirID, FSSpecPtr redirectINI)
|
||||
err = FSMakeFSSpec(vRefNum, dirID, "\pGetRedirect.idi", &getRedirectIDI);
|
||||
if (err == noErr)
|
||||
FSpDelete(&getRedirectIDI);
|
||||
err = FSpCreate(&getRedirectIDI, 'NSCP', 'TEXT', smSystemScript);
|
||||
if ((err != noErr) && (err != dupFNErr))
|
||||
{
|
||||
ErrorHandler(err);
|
||||
return false;
|
||||
}
|
||||
err = FSpOpenDF(&getRedirectIDI, fsRdWrPerm, &refNum);
|
||||
if (err != noErr)
|
||||
{
|
||||
@ -315,20 +321,30 @@ DownloadRedirect(short vRefNum, long dirID, FSSpecPtr redirectINI)
|
||||
#endif /* SDINST_IS_DLL */
|
||||
#endif /* MOZILLA */
|
||||
|
||||
bSuccess = false;
|
||||
for (i = 0; i < gControls->cfg->redirect.numURLs; i++)
|
||||
{
|
||||
/* verify redirect.ini existence */
|
||||
HLock(gControls->cfg->redirect.url[0]);
|
||||
leaf = strrchr(*(gControls->cfg->redirect.url[0]), '/');
|
||||
HLock(gControls->cfg->redirect.url[i]);
|
||||
leaf = strrchr(*(gControls->cfg->redirect.url[i]), '/');
|
||||
if (!leaf)
|
||||
{
|
||||
bSuccess = false;
|
||||
goto BAIL;
|
||||
}
|
||||
pLeaf = CToPascal(leaf+1);
|
||||
HUnlock(gControls->cfg->redirect.url[0]);
|
||||
HUnlock(gControls->cfg->redirect.url[i]);
|
||||
|
||||
err = FSMakeFSSpec(vRefNum, dirID, pLeaf, redirectINI);
|
||||
if (err != noErr)
|
||||
bSuccess = false;
|
||||
if (err == noErr)
|
||||
{
|
||||
bSuccess = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bSuccess)
|
||||
FSMakeFSSpec(0, 0, "\p", redirectINI);
|
||||
|
||||
BAIL:
|
||||
if (buf)
|
||||
|
@ -314,7 +314,7 @@ if (err) \
|
||||
#define sSiteSelector 42
|
||||
#define sDomain 43
|
||||
#define sDescription 44
|
||||
#define sRedirect 45
|
||||
#define sRedirect 46
|
||||
|
||||
#define sTermDlg 27
|
||||
|
||||
|
@ -470,14 +470,9 @@ PopulateCompWinKeys(char *cfgText)
|
||||
DisposePtr(idxCh);
|
||||
strncat(currKey, eof, 1);
|
||||
|
||||
if (!FillKeyValueUsingName(currSName, currKey, gControls->cfg->comp[i].domain[j], cfgText))
|
||||
{
|
||||
if (currKey)
|
||||
DisposePtr(currKey);
|
||||
if (currKeyBuf)
|
||||
DisposePtr(currKeyBuf);
|
||||
break;
|
||||
}
|
||||
// don't break if this fails since there may be more Server Paths thatn Domains
|
||||
FillKeyValueUsingName(currSName, currKey, gControls->cfg->comp[i].domain[j], cfgText);
|
||||
|
||||
if (currKey)
|
||||
DisposePtr(currKey);
|
||||
if (currKeyBuf)
|
||||
@ -740,7 +735,7 @@ PopulateTermWinKeys(char *cfgText)
|
||||
cDesc = PascalToC(pDescRoot);
|
||||
cURL = NewPtrClear(pURLRoot[0] + 4);
|
||||
if (!cURL || !cSection || !cDesc)
|
||||
return eParseFailed;
|
||||
return eMem;
|
||||
|
||||
gControls->cfg->redirect.desc = NewHandleClear(kValueMaxLen);
|
||||
if (FillKeyValueUsingResID(sRedirect, sDescription, gControls->cfg->redirect.desc, cfgText))
|
||||
|
Loading…
Reference in New Issue
Block a user