Bug #264467 --> Crash when renaming a local folder to have a forward slash in it.

sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2004-10-26 04:44:55 +00:00
Родитель 3eeb159f47
Коммит 4d7d72f381
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -1116,6 +1116,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName, nsIMsgWind
nsCAutoString newDiskName;
newDiskName.Assign(convertedNewName.get());
NS_MsgHashIfNecessary(newDiskName);
nsAutoString safeFolderName;
safeFolderName.AssignWithConversion(newDiskName);
nsXPIDLCString oldLeafName;
oldPathSpec->GetLeafName(getter_Copies(oldLeafName));
@ -1170,7 +1172,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName, nsIMsgWind
nsCOMPtr<nsIMsgFolder> newFolder;
if (parentSupport)
{
rv = parentFolder->AddSubfolder(nsDependentString(aNewName), getter_AddRefs(newFolder));
rv = parentFolder->AddSubfolder(safeFolderName, getter_AddRefs(newFolder));
if (newFolder)
{
newFolder->SetPrettyName(aNewName);