nsSpecialSystemDirectory systemDir(nsSpecialSystemDirectory::Win_WindowsDirectory);
char *unixProfileName = PR_GetEnv(PROFILE_NAME_ENVIRONMENT_VARIABLE); char *unixProfileDirectory = PR_GetEnv(PROFILE_HOME_ENVIRONMENT_VARIABLE);  if (!unixProfileName || !unixProfileDirectory || (PL_strlen(unixProfileName) == 0) || (PL_strlen(unixProfileDirectory) == 0)) { unixProfileName = PR_GetEnv(USER_ENVIRONMENT_VARIABLE); unixProfileDirectory = PR_GetEnv(HOME_ENVIRONMENT_VARIABLE); }  if (unixProfileName && unixProfileDirectory) { PL_strcpy(gOldProfiles[g_numOldProfiles], nsUnescape(unixProfileName)); PL_strcpy(gOldProfLocations[g_numOldProfiles], unixProfileDirectory); PL_strcat(gOldProfLocations[g_numOldProfiles], "/.netscape"); #ifdef DEBUG_profile printf("unix profile is %s, unix profile dir is %s\n",gOldProfiles[g_numOldProfiles],gOldProfLocations[g_numOldProfiles]);
NS_IMETHODIMP nsProfile::MigrateProfileInfo(){    nsresult rv = NS_OK;#if defined(XP_PC) || defined(XP_MAC)#if defined(DEBUG_profile_verbose)    printf("Entered MigrateProfileInfo.\n");#endif    char oldRegFile[_MAX_LENGTH] = {'\0'};#ifdef XP_PC#ifdef XP_OS2    nsSpecialSystemDirectory systemDir(nsSpecialSystemDirectory::OS2_OS2Directory);#else    // Registry file has been traditionally stored in the windows directory (XP_PC).    nsSpecialSystemDirectory systemDir(nsSpecialSystemDirectory::Win_WindowsDirectory);#endif        // Append the name of the old registry to the path obtained.    PL_strcpy(oldRegFile, systemDir.GetNativePathCString());    PL_strcat(oldRegFile, OLD_REGISTRY_FILE_NAME);#else /* XP_MAC */    nsSpecialSystemDirectory regLocation(nsSpecialSystemDirectory::Mac_PreferencesDirectory);        // Append the name of the old registry to the path obtained.    regLocation += OLD_REGISTRY_FILE_NAME;        PL_strcpy(oldRegFile, regLocation.GetNativePathCString());#endif /* XP_PC */    rv = gProfileDataAccess->Get4xProfileInfo(oldRegFile);#elif defined (XP_BEOS)#else    /* XP_UNIX */    rv = gProfileDataAccess->Get4xProfileInfo(nsnull);#endif /* XP_PC || XP_MAC */    gProfileDataAccess->mProfileDataChanged = PR_TRUE;    gProfileDataAccess->UpdateRegistry(nsnull);	return rv;}