char *currProfile = nsnull;
gProfileDataAccess->mProfileDataChanged = PR_TRUE; gProfileDataAccess->UpdateRegistry(nsnull);
NS_IMETHODIMP nsProfile::RenameProfile(const char* oldName, const char* newName){	nsresult rv = NS_OK;#if defined(DEBUG_profile)    printf("ProfileManager : Renaming profile %s to %s \n", oldName, newName);#endif	rv = ProfileExists(newName);	// That profile already exists...	if (NS_SUCCEEDED(rv))	{#if defined(DEBUG_profile)  		printf("ProfileManager : Rename Operation failed : Profile exists. Provide a different new name for profile.\n");#endif		return NS_ERROR_FAILURE;	}	char *currProfile = nsnull;	GetCurrentProfile(&currProfile);	// If renaming the current profile set the renameCurrProfile flag to true	// By default the flag is set to false.	if (currProfile)	{		if (PL_strcmp(oldName, currProfile) == 0)		{			renameCurrProfile = PR_TRUE;	#if defined(DEBUG_profile)				printf("ProfileManager : Renaming the current profile\n");#endif		}	}	// Copy reg keys	CopyRegKey(oldName, newName);	// Delete old profile entry		DeleteProfile(oldName, "false");	// If we renamed current profile, the new profile will be the current profile	if (renameCurrProfile)	{		rv = m_reg->OpenDefault();		if (NS_SUCCEEDED(rv))		{			nsIRegistry::Key profileRootKey;			rv = m_reg->GetSubtree(nsIRegistry::Common, "Profiles", &profileRootKey);			if (NS_SUCCEEDED(rv))			{				rv = m_reg->SetString(profileRootKey, "CurrentProfile", newName);			}			m_reg->Close();		}		renameCurrProfile = PR_FALSE;	}   	return rv;}