return prefFileName->GetData(aFileLocation);
return prefFileName->ToString(aFileLocation);
GetFileLocation(const char* aPrefName,                const char* aEnvVarName,                PRUnichar** aFileLocation) {  LOG(("-- GetFileLocation.  Pref: '%s'  EnvVar: '%s'\n",       aPrefName,       aEnvVarName));  NS_PRECONDITION(aPrefName, "Null pref name passed; don't do that!");    nsresult rv;  *aFileLocation = nsnull;  /* The lookup order is:     1) user pref     2) env var     3) pref  */  nsCOMPtr<nsIPrefService> prefService(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIPrefBranch> prefBranch;  rv = prefService->GetBranch(nsnull, getter_AddRefs(prefBranch));  NS_ENSURE_SUCCESS(rv, rv);  /*    If we have an env var we should check whether the pref is a user    pref.  If we do not, we don't care.  */  nsCOMPtr<nsISupportsString> prefFileName;  PRBool isUserPref = PR_FALSE;  prefBranch->PrefHasUserValue(aPrefName, &isUserPref);  if (isUserPref) {    rv = prefBranch->GetComplexValue(aPrefName,                                     NS_GET_IID(nsISupportsString),                                     getter_AddRefs(prefFileName));    if (NS_SUCCEEDED(rv)) {      return prefFileName->GetData(aFileLocation);    }  }  if (aEnvVarName && *aEnvVarName) {    char* prefValue = PR_GetEnv(aEnvVarName);    if (prefValue && *prefValue) {      // the pref is in the system charset and it's a filepath... The      // natural way to do the charset conversion is by just initing      // an nsIFile with the native path and asking it for the Unicode      // version.      nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));      NS_ENSURE_SUCCESS(rv, rv);      rv = file->InitWithNativePath(nsDependentCString(prefValue));      NS_ENSURE_SUCCESS(rv, rv);      nsAutoString unicodePath;      rv = file->GetPath(unicodePath);      NS_ENSURE_SUCCESS(rv, rv);            *aFileLocation = ToNewUnicode(unicodePath);      if (!*aFileLocation)        return NS_ERROR_OUT_OF_MEMORY;      return NS_OK;    }  }    rv = prefBranch->GetComplexValue(aPrefName,                                   NS_GET_IID(nsISupportsString),                                   getter_AddRefs(prefFileName));  if (NS_SUCCEEDED(rv)) {    return prefFileName->GetData(aFileLocation);  }    return rv;}