Fixing bug 122309. Using new ParseString routine to parse ports list. r=dougt, sr=jag

This commit is contained in:
racham%netscape.com 2002-02-05 08:39:30 +00:00
Родитель c5701870fa
Коммит f53e918c74
1 изменённых файлов: 6 добавлений и 6 удалений

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

@ -997,14 +997,14 @@ nsIOService::ParsePortList(nsIPrefBranch *prefBranch, const char *pref, PRBool r
// Get a pref string and chop it up into a list of ports.
prefBranch->GetCharPref(pref, getter_Copies(portList));
if (portList) {
char* tokp;
char* currentPos = (char *)portList.get();
while ((tokp = nsCRT::strtok(currentPos, ",", &currentPos))) {
nsCAutoString tmp(tokp);
tmp.StripWhitespace();
nsCStringArray portListArray;
portListArray.ParseString(portList.get(), ",");
PRInt32 index;
for (index=0; index < portListArray.Count(); index++) {
portListArray[index]->StripWhitespace();
PRInt32 aErrorCode;
PRInt32 value = tmp.ToInteger(&aErrorCode);
PRInt32 value = portListArray[index]->ToInteger(&aErrorCode);
if (remove)
mRestrictedPortList.RemoveElement((void*)value);
else