printf("Search engine to query: '%s'\n", basename);
printf("Search engine to query: '%s'\n", baseFilename);
SearchDataSource::BeginSearchRequest(nsIRDFResource *source){        nsresult		rv = NS_OK;	char			*sourceURI = nsnull;	if (NS_FAILED(rv = source->GetValue(&sourceURI)))		return(rv);	nsAutoString		uri(sourceURI);	if (uri.Find("internetsearch:") != 0)		return(NS_ERROR_FAILURE);	uri.Cut(0, strlen("internetsearch:"));	nsVoidArray	*engineArray = new nsVoidArray;	if (!engineArray)		return(NS_ERROR_FAILURE);	nsAutoString	text("");	// parse up attributes	while(uri.Length() > 0)	{		nsAutoString	item("");		PRInt32 andOffset = uri.Find("&");		if (andOffset >= 0)		{			uri.Left(item, andOffset);			uri.Cut(0, andOffset + 1);		}		else		{			item = uri;			uri.Truncate();		}		PRInt32 equalOffset = item.Find("=");		if (equalOffset < 0)	break;				nsAutoString	attrib(""), value("");		item.Left(attrib, equalOffset);		value = item;		value.Cut(0, equalOffset + 1);				if ((attrib.Length() > 0) && (value.Length() > 0))		{			if (attrib.EqualsIgnoreCase("engine"))			{				if (value.Find(kEngineProtocol) == 0)				{					char	*val = value.ToNewCString();					if (val)					{						engineArray->AppendElement(val);					}				}			}			else if (attrib.EqualsIgnoreCase("text"))			{				text = value;			}		}	}	// loop over specified search engines	while (engineArray->Count() > 0)	{		char *basename = (char *)(engineArray->ElementAt(0));		engineArray->RemoveElementAt(0);		if (!basename)	continue;#ifdef	DEBUG		printf("Search engine to query: '%s'\n", basename);#endif		nsCOMPtr<nsIRDFResource>	engine;		gRDFService->GetResource(basename, getter_AddRefs(engine));		delete [] basename;		basename = nsnull;		if (!engine)	continue;		DoSearch(source, engine, text);	}		delete engineArray;	engineArray = nsnull;	return(rv);}