gracefully handle snewsrc entries in the fat file. thanks to bienvenu for finding the bug.

This commit is contained in:
sspitzer%netscape.com 1999-07-21 20:45:06 +00:00
Родитель bd9b503755
Коммит 04c4c2455a
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -1465,13 +1465,14 @@ nsMsgAccountManager::MigrateNewsAccounts(nsIMsgIdentity *identity, PRInt32 baseA
numAccounts++; numAccounts++;
// psuedo-name is of the form newsrc-<host>. need to get the host part out. // psuedo-name is of the form newsrc-<host> or snewsrc-<host>.
// right now, we can't handle snewsrc, so if we get one of those
NS_ASSERTION(PL_strncmp(PSUEDO_NAME_PREFIX,psuedo_name,PL_strlen(PSUEDO_NAME_PREFIX)) == 0, "all psuedo names should begin with newsrc-"); // gracefully handle it by ignoring it.
if (PL_strncmp(PSUEDO_NAME_PREFIX,psuedo_name,PL_strlen(PSUEDO_NAME_PREFIX)) != 0) { if (PL_strncmp(PSUEDO_NAME_PREFIX,psuedo_name,PL_strlen(PSUEDO_NAME_PREFIX)) != 0) {
return 0; continue;
} }
// check that there is a hostname to get after the "newsrc-" part
NS_ASSERTION(PL_strlen(psuedo_name) > PL_strlen(PSUEDO_NAME_PREFIX), "psuedo_name is too short"); NS_ASSERTION(PL_strlen(psuedo_name) > PL_strlen(PSUEDO_NAME_PREFIX), "psuedo_name is too short");
if (PL_strlen(psuedo_name) <= PL_strlen(PSUEDO_NAME_PREFIX)) { if (PL_strlen(psuedo_name) <= PL_strlen(PSUEDO_NAME_PREFIX)) {
return 0; return 0;