if (NS_SUCCEEDED(rv) && mimeFinder) mimeFinder->GetTypeFromExtension(ext, &retType);
if (mimeFinder) { nsCAutoString type; mimeFinder->GetTypeFromExtension(nsDependentCString(ext), type); retType = ToNewCString(type); }
mime_file_type (const char *filename, void *stream_closure){  char        *retType = nsnull;  char        *ext = nsnull;  nsresult    rv;  ext = PL_strrchr(filename, '.');  if (ext)  {    ext++;    nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_CONTRACTID, &rv));    if (NS_SUCCEEDED(rv) && mimeFinder)       mimeFinder->GetTypeFromExtension(ext, &retType);  }  return retType;}