} else returnString = hostStr;
GenerateFileNameFromURI(nsIURI *aURL){  nsresult    rv;   nsXPIDLCString file;  nsXPIDLCString spec;;  char        *returnString;  char        *cp = nsnull;  char        *cp1 = nsnull;  rv = aURL->GetPath(getter_Copies(file));  if ( NS_SUCCEEDED(rv) && file)  {    char *newFile = PL_strdup(file);    if (!newFile)      return nsnull;    // strip '/'    cp = PL_strrchr(newFile, '/');    if (cp)      ++cp;    else      cp = newFile;    if (*cp)    {      if ((cp1 = PL_strchr(cp, '/'))) *cp1 = 0;        if ((cp1 = PL_strchr(cp, '?'))) *cp1 = 0;        if ((cp1 = PL_strchr(cp, '>'))) *cp1 = 0;        if (*cp != '\0')      {        returnString = PL_strdup(cp);        PR_FREEIF(newFile);        return returnString;      }    }  }  cp = nsnull;  cp1 = nsnull;  rv = aURL->GetSpec(getter_Copies(spec));  if ( NS_SUCCEEDED(rv) && spec)  {    char *newSpec = PL_strdup(spec);    if (!newSpec)      return nsnull;    char *cp2 = NULL, *cp3=NULL ;    // strip '"'     cp2 = newSpec;    while (*cp2 == '"')       cp2++;    if ((cp3 = PL_strchr(cp2, '"')))      *cp3 = 0;    char *hostStr = nsMsgParseURLHost(cp2);    if (!hostStr)      hostStr = cp2;    nsXPIDLCString protocol;    if (NS_SUCCEEDED(aURL->GetScheme(getter_Copies(protocol))) && (protocol))    {      if (PL_strcasecmp(protocol, "http") == 0)      {        returnString = PR_smprintf("%s.html", hostStr);        PR_FREEIF(hostStr);      }      else        returnString = hostStr;    }    else      returnString = hostStr;    PR_FREEIF(newSpec);    return returnString;  }  return nsnull;}