Bug 1175242, Do not delete an existing maildir folder if asked to create, r=neil, a=rkent
authorR Kent James <rkent@caspia.com>
Mon, 07 Sep 2015 18:23:30 -0700
changeset 26355 addd9fa53b40010d10cf47615fda7c99f5d5a4d5
parent 26354 8f8ed2761bf70e9ca1708f49d2d4ce4651065ecb
child 26356 b378d2df070c803b0909466673e86980591c7ed2
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, rkent
bugs1175242
Bug 1175242, Do not delete an existing maildir folder if asked to create, r=neil, a=rkent
mailnews/local/src/nsMsgMaildirStore.cpp
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -198,16 +198,20 @@ NS_IMETHODIMP nsMsgMaildirStore::CreateF
   rv = CreateDirectoryForFolder(path, isServer);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Make sure the new folder name is valid
   nsAutoString safeFolderName(aFolderName);
   NS_MsgHashIfNecessary(safeFolderName);
 
   path->Append(safeFolderName);
+  bool exists;
+  path->Exists(&exists);
+  if (exists) //check this because localized names are different from disk names
+    return NS_MSG_FOLDER_EXISTS;
 
   rv = CreateMaildir(path);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgFolder> child;
   // GetFlags and SetFlags in AddSubfolder will fail because we have no db at
   // this point but mFlags is set.
   rv = aParent->AddSubfolder(safeFolderName, getter_AddRefs(child));