nsString path; path.AssignWithConversion(kDTDDirectory); path.AppendWithConversion(fileName.get()); dtdPath += path;
nsCAutoString path(kDTDDirectory); path.Append(fileName); dtdPath += path.get();
IsLoadableDTD(nsCOMPtr<nsIURI>* aDTD){  PRBool isLoadable = PR_FALSE;  nsresult res = NS_OK;  if (!aDTD || !*aDTD) {    NS_ASSERTION(0, "Null parameter.");    return PR_FALSE;  }  // Return true if the url is a chrome url  res = (*aDTD)->SchemeIs("chrome", &isLoadable);  // If the url is not a chrome url, check to see if a DTD file of the same name  // exists in the special DTD directory  if (!isLoadable) {       nsCOMPtr<nsIURL> dtdURL;    dtdURL = do_QueryInterface(*aDTD, &res);    if (NS_SUCCEEDED(res)) {      nsXPIDLCString fileName;          res = dtdURL->GetFileName(getter_Copies(fileName));      if (NS_SUCCEEDED(res) && fileName) {        nsSpecialSystemDirectory dtdPath(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);        nsString path; path.AssignWithConversion(kDTDDirectory);                path.AppendWithConversion(fileName.get());        dtdPath += path;        if (dtdPath.Exists()) {          // The DTD was found in the local DTD directory.          // Set aDTD to a file: url pointing to the local DTD          nsFileURL dtdFile(dtdPath);          nsCOMPtr<nsIURI> dtdURI;          res = NS_NewURI(getter_AddRefs(dtdURI), dtdFile.GetURLString());          if (NS_SUCCEEDED(res) && dtdURI) {            *aDTD = dtdURI;            isLoadable = PR_TRUE;          }        }      }    }  }    return isLoadable;}