Added an error check for charset conversion result for mail folder creation,

patch by mkaply@us.ibm.com,
bug 156336, r=naving, sr=bienvenu.
This commit is contained in:
nhotta%netscape.com 2002-09-16 17:23:59 +00:00
Родитель c5aa6afa44
Коммит ba37d816b6
2 изменённых файлов: 7 добавлений и 1 удалений

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

@ -64,6 +64,7 @@ downloadingMail=Downloading Mail for Offline Use
sendingUnsent=Sending Unsent Messages
folderExists=A folder with that name already exists. Please enter a different name.
folderCreationFailed=The folder could not be created because the folder name you specified contains an unrecognized character. Please enter a different name and try again.
compactingFolder=Compacting folder %S...
autoCompactAllFolders=Do you wish to compact all local and offline folders to save disk space?
confirmFolderDeletionForFilter=Deleting the folder '%S' will disable its associated filter(s). Are you sure you want to delete the folder?

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

@ -818,8 +818,13 @@ nsMsgLocalMailFolder::CreateSubfolder(const PRUnichar *folderName, nsIMsgWindow
return rv;
nsXPIDLCString nativeFolderName;
ConvertFromUnicode(nsMsgI18NFileSystemCharset(), nsAutoString(folderName),
rv = ConvertFromUnicode(nsMsgI18NFileSystemCharset(), nsAutoString(folderName),
getter_Copies(nativeFolderName));
if (NS_FAILED(rv) || (nativeFolderName.Length() == 0)) {
ThrowAlertMsg("folderCreationFailed", msgWindow);
// I'm returning this value so the dialog stays up
return NS_MSG_FOLDER_EXISTS;
}
nsCAutoString safeFolderName;
safeFolderName.Assign(nativeFolderName.get());