}  rv = m_reg->SetString(newKey, "migrated", "no");  if (NS_FAILED(rv)) {
}  rv = m_reg->SetString(newKey, REGISTRY_MIGRATED_STRING, REGISTRY_NO_STRING);  if (NS_FAILED(rv)) {
NS_IMETHODIMP nsProfile::UpdateMozProfileRegistry(){	nsresult rv = NS_OK;    PRBool openalready = PR_FALSE;     #if defined(DEBUG_profile)    printf("Entered UpdateMozProfileRegistry.\n");#endif	for (int idx = 0; idx < g_numOldProfiles; idx++)	{		// Check result.		if (m_reg != nsnull)		{			// Open the registry file.			rv = m_reg->IsOpen( &openalready );					if ( !openalready )				rv = m_reg->OpenDefault();    			if (NS_SUCCEEDED(rv))			{				nsIRegistry::Key key;				rv = m_reg->GetSubtree(nsIRegistry::Common, "Profiles", &key);				if (NS_SUCCEEDED(rv))				{					nsIRegistry::Key newKey;					rv = m_reg->SetString(key, "NeedMigration", "true");					rv = m_reg->GetSubtree(key, gOldProfiles[idx], &newKey);								if (NS_FAILED(rv))					{						rv = m_reg->AddSubtree(key, gOldProfiles[idx], &newKey);								if (NS_SUCCEEDED(rv))						{							nsFileSpec profileDir(gOldProfLocations[idx]);														nsXPIDLCString profileDirString;								nsCOMPtr<nsIFileSpec>spec;							rv = NS_NewFileSpecWithSpec(profileDir, getter_AddRefs(spec));							if (NS_SUCCEEDED(rv)) {								rv = spec->GetPersistentDescriptorString(getter_Copies(profileDirString));							}							if (NS_SUCCEEDED(rv) && profileDirString)							{								rv = m_reg->SetString(newKey, "directory", profileDirString);																if (NS_FAILED(rv))								{#if defined(DEBUG_profile)										printf("Couldn't set directory property.\n" );#endif								}															rv = m_reg->SetString(newKey, "migrated", "no");															if (NS_FAILED(rv))								{#if defined(DEBUG_profile)										printf("Couldn't add migrate flag.\n" );#endif								}							}							else							{#if defined(DEBUG_profile)									printf("NULL value received for directory name.\n" );#endif							}						}						else						{#if defined(DEBUG_profile)								printf("Profiles : Could not add profile subtree.\n" );#endif						}					}					else					{#if defined(DEBUG_profile)							printf("Profiles : Profile name subtree already exists.\n" );#endif					}				}				else				{#if defined(DEBUG_profile)						printf("Registry : Couldn't get Profiles subtree.\n");#endif				}				if (!openalready)					m_reg->Close();			}			else			{#if defined(DEBUG_profile)					printf("Couldn't open registry.\n");#endif			}		}		}	return rv;}