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 22175 58290f457bc5d51088352f607b454cd959e8dcdc
parent 22174 663123420b3f212d2a3540daf06950e184a374f1
child 22176 7b835a634206df88bf654a87c187fe3c2f0f3e74
push id43
push userkent@caspia.com
push dateMon, 14 Sep 2015 21:13:06 +0000
treeherdercomm-esr38@7b835a634206 [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));