Used nsCAutoString function to find if there is port appended to popServerName and then used

truncate to get the popServerNamewithoutPort.
This commit is contained in:
naving%netscape.com 2000-09-01 01:02:15 +00:00
Родитель b454b7f9a0
Коммит d948c0a5f6
1 изменённых файлов: 10 добавлений и 10 удалений

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

@ -917,17 +917,17 @@ nsPrefMigration::ProcessPrefsCallback(const char* oldProfilePathStr, const char
m_prefs->CopyCharPref(PREF_NETWORK_HOSTS_POP_SERVER, &popServerName);
//popServerName = strtok (popServerName,":");
int i =0;
while (popServerName[i] != '\0' ){
if ( popServerName[i] == ':' ) {
popServerName[i] = '\0';
break;
}
i++;
}
nsCAutoString popServerNamewithoutPort(popServerName);
PRInt32 colonPos = popServerNamewithoutPort.FindChar(':');
if (colonPos != -1 ) {
popServerNamewithoutPort.Truncate(colonPos);
rv = newPOPMailPath->AppendRelativeUnixPath(popServerNamewithoutPort);
}
else {
rv = newPOPMailPath->AppendRelativeUnixPath(popServerName);
}
if (NS_FAILED(rv)) return rv;
rv = newPOPMailPath->Exists(&exists);