From 04c4c2455ab76e3d673d8f05f8b6b0a5b4ffe8b8 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 21 Jul 1999 20:45:06 +0000 Subject: [PATCH] gracefully handle snewsrc entries in the fat file. thanks to bienvenu for finding the bug. --- mailnews/base/src/nsMsgAccountManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mailnews/base/src/nsMsgAccountManager.cpp b/mailnews/base/src/nsMsgAccountManager.cpp index 6dbf77ba634..e6c8934de37 100644 --- a/mailnews/base/src/nsMsgAccountManager.cpp +++ b/mailnews/base/src/nsMsgAccountManager.cpp @@ -1465,13 +1465,14 @@ nsMsgAccountManager::MigrateNewsAccounts(nsIMsgIdentity *identity, PRInt32 baseA numAccounts++; - // psuedo-name is of the form newsrc-. need to get the host part out. - - NS_ASSERTION(PL_strncmp(PSUEDO_NAME_PREFIX,psuedo_name,PL_strlen(PSUEDO_NAME_PREFIX)) == 0, "all psuedo names should begin with newsrc-"); + // psuedo-name is of the form newsrc- or snewsrc-. + // right now, we can't handle snewsrc, so if we get one of those + // gracefully handle it by ignoring it. 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"); if (PL_strlen(psuedo_name) <= PL_strlen(PSUEDO_NAME_PREFIX)) { return 0;