if (PREF_NOERROR == pPref->CreateChildList(scratch, &childList))
PRUint32 prefCount; status = pPref->GetChildList(scratch, &prefCount, &childList); if (NS_SUCCEEDED(status))
static nsresult DIR_GetCustomFilterPrefs(const char *prefstring, DIR_Server *server, char *scratch){    nsresult status = NS_OK;    nsCOMPtr<nsIPref> pPref(do_GetService(NS_PREF_CONTRACTID, &status));     if (NS_FAILED(status) || !pPref) 		return NS_ERROR_FAILURE;	PRBool keepGoing = PR_TRUE;	PRInt32 filterNum = 1;	char *localScratch = (char*)PR_Malloc(128);	if (!localScratch)		return NS_ERROR_OUT_OF_MEMORY;	server->tokenSeps = DIR_GetStringPref (prefstring, "wordSeparators", localScratch, kDefaultTokenSeps);	while (keepGoing && NS_SUCCEEDED(status))	{		char *childList = nsnull;		PR_snprintf (scratch, 128, "%s.filter%d", prefstring, filterNum);		if (PREF_NOERROR == pPref->CreateChildList(scratch, &childList))		{			if ('\0' != childList[0])			{				DIR_Filter *filter = (DIR_Filter*) PR_Malloc (sizeof(DIR_Filter));				if (filter)				{					PRBool tempBool;					memset(filter, 0, sizeof(DIR_Filter));					/* Pull per-filter preferences out of JS values */					filter->string = DIR_GetStringPref (scratch, "string", localScratch, 						server->efficientWildcards ? kDefaultFilter : kDefaultEfficientFilter);					tempBool = DIR_GetBoolPref (scratch, "repeatFilterForWords", localScratch, kDefaultRepeatFilterForTokens);					if (tempBool)						filter->flags |= DIR_F_REPEAT_FILTER_FOR_TOKENS;					tempBool = DIR_GetBoolPref (scratch, "substituteStarsForSpaces", localScratch, kDefaultSubstStarsForSpaces);					if (tempBool)						filter->flags |= DIR_F_SUBST_STARS_FOR_SPACES;					/* Add resulting DIR_Filter to the list */					if (!server->customFilters)						server->customFilters = new nsVoidArray();					if (server->customFilters)						server->customFilters->AppendElement(filter);					else						status = NS_ERROR_OUT_OF_MEMORY;				}				else					status = NS_ERROR_OUT_OF_MEMORY;				filterNum++;			}			else				keepGoing = PR_FALSE;			PR_Free(childList);		}		else			keepGoing = PR_FALSE;	}	PR_Free(localScratch);	return status;}