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 22883 018e557a74f3c5bb34b874c1fe1d96bea027be69
parent 22882 722eb27dc2477059bd9210b31cc45b1438402d99
child 22884 166d8e44fb957be701d3163099599caf846e06e8
push id1464
push userkent@caspia.com
push dateMon, 14 Sep 2015 21:12:19 +0000
treeherdercomm-beta@166d8e44fb95 [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));