server->fileName = name.ToNewCString();
server->fileName = ToNewCString(name);
static nsresult dir_ConvertToMabFileName(){	if (dir_ServerList)	{		PRInt32 count = dir_ServerList->Count();		PRInt32 i;		for (i = 0; i < count; i++)		{			DIR_Server *server = (DIR_Server *)dir_ServerList->ElementAt(i);			// convert for main personal addressbook only			// do other address book when convert from 4.5 to mork is done			if (server && server->position == 1 && server->fileName)			{				nsString name; name.AssignWithConversion(server->fileName);				PRInt32 pos = name.Find(ABFileName_kPreviousSuffix);				if (pos > 0)				{					//Move old abook.na2 to end of the list and change the description					DIR_Server * newServer = nsnull;					DIR_CopyServer(server, &newServer);					newServer->position = count + 1;					char *newDescription = PR_smprintf("%s 4.x", newServer->description);					PR_FREEIF(newServer->description);					newServer->description = newDescription;					char *newPrefName = PR_smprintf("%s4x", newServer->prefName);					PR_FREEIF(newServer->prefName);					newServer->prefName = newPrefName;					dir_ServerList->AppendElement(newServer);					DIR_SavePrefsForOneServer(newServer);					PR_FREEIF (server->fileName);                    server->fileName = nsCRT::strdup(kPersonalAddressbook);					DIR_SavePrefsForOneServer(server);				}			}#ifdef CONVERT_TO_MORK_DONE			if (server && server->fileName)			{				nsString name(server->fileName);				PRInt32 pos = name.Find(ABFileName_kPreviousSuffix);				if (pos)				{					name.Cut(pos, PL_strlen(ABFileName_kPreviousSuffix));					name.Append(ABFileName_kCurrentSuffix);					PR_FREEIF (server->fileName);					server->fileName = name.ToNewCString();				}				DIR_SavePrefsForOneServer(server);			}#endif /* CONVERT_TO_MORK_DONE */		}	}	return NS_OK;}