if (jsValue && jsValue[0]) { char *attrName = child + PL_strlen(scratch) + 1; DIR_AddCustomAttribute (server, attrName, jsValue); } PR_FREEIF(jsValue);
char *attrName = childList[i] + PL_strlen(scratch) + 1; DIR_AddCustomAttribute (server, attrName, jsValue);
static nsresult DIR_GetCustomAttributePrefs(const char *prefstring, DIR_Server *server, char *scratch){    nsresult rv = NS_OK;    nsCOMPtr<nsIPref> pPref(do_GetService(NS_PREF_CONTRACTID, &rv));     if (NS_FAILED(rv) || !pPref) 		return NS_ERROR_FAILURE;	char **tokenList = nsnull;	char *childList = nsnull;	PL_strcpy(scratch, prefstring);	PL_strcat(scratch, ".attributes");	if (PREF_NOERROR == pPref->CreateChildList(scratch, &childList))	{		if (childList && childList[0])		{			char *child = nsnull;			PRInt16 indx = 0;			while ((pPref->NextChild (childList, &indx, &child)) == NS_OK)			{				char *jsValue = nsnull;				if (PREF_NOERROR == pPref->CopyCharPref (child, &jsValue))				{					if (jsValue && jsValue[0])					{						char *attrName = child + PL_strlen(scratch) + 1;						DIR_AddCustomAttribute (server, attrName, jsValue);					}					PR_FREEIF(jsValue);				}			}		}		PR_FREEIF(childList);	}	if (0 == dir_CreateTokenListFromPref (prefstring, "basicSearchAttributes", scratch, 		&tokenList, &server->basicSearchAttributesCount))	{		dir_ConvertTokenListToIdList (server, tokenList, server->basicSearchAttributesCount, 			&server->basicSearchAttributes);		dir_DeleteTokenList (tokenList, server->basicSearchAttributesCount);	}	/* The DN, suppressed and url attributes can be attributes that	 * we've never heard of, so they're stored by name, so we can match 'em	 * as we get 'em from the server	 */	dir_CreateTokenListFromPref (prefstring, "html.dnAttributes", scratch, 		&server->dnAttributes, &server->dnAttributesCount);	dir_CreateTokenListFromPref (prefstring, "html.excludedAttributes", scratch, 		&server->suppressedAttributes, &server->suppressedAttributesCount);	dir_CreateTokenListFromPref (prefstring, "html.uriAttributes", scratch, 		&server->uriAttributes, &server->uriAttributesCount);	return NS_OK;}