Bug 1593540 - Follow-up to bug 1587067: Check install path match before trying to match x68 path. r=mossop DONTBUILD
authorJorg K <jorgk@jorgk.com>
Mon, 04 Nov 2019 18:26:35 +0000
changeset 500425 878f3ec585173b7e1db20bfa750da33ac9f25c7e
parent 500424 3c8dd2d6181abb1b78b08b5321afdac9b3240575
child 500426 8e192f9c8f844623a1b0a2d96b0c8ca22543f183
push id114164
push useraiakab@mozilla.com
push dateTue, 05 Nov 2019 10:06:15 +0000
treeherdermozilla-inbound@4d585c7edc76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1593540, 1587067
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1593540 - Follow-up to bug 1587067: Check install path match before trying to match x68 path. r=mossop DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D51534
toolkit/profile/nsToolkitProfileService.cpp
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -483,21 +483,26 @@ bool nsToolkitProfileService::IsProfileF
   rv = NS_NewNativeLocalFile(EmptyCString(), false, getter_AddRefs(lastGreDir));
   NS_ENSURE_SUCCESS(rv, false);
 
   rv = lastGreDir->SetPersistentDescriptor(lastGreDirStr);
   NS_ENSURE_SUCCESS(rv, false);
 
 #ifdef XP_WIN
 #  if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE)
-  // Convert a 64-bit install path to what would have been the 32-bit install
-  // path to allow users to migrate their profiles from one to the other.
   mozilla::PathString lastGreDirPath, currentGreDirPath;
   lastGreDirPath = lastGreDir->NativePath();
   currentGreDirPath = currentGreDir->NativePath();
+  if (lastGreDirPath.Equals(currentGreDirPath,
+                            nsCaseInsensitiveStringComparator())) {
+    return true;
+  }
+
+  // Convert a 64-bit install path to what would have been the 32-bit install
+  // path to allow users to migrate their profiles from one to the other.
   PWSTR pathX86 = nullptr;
   HRESULT hres =
       SHGetKnownFolderPath(FOLDERID_ProgramFilesX86, 0, nullptr, &pathX86);
   if (SUCCEEDED(hres)) {
     nsDependentString strPathX86(pathX86);
     if (!StringBeginsWith(currentGreDirPath, strPathX86,
                           nsCaseInsensitiveStringComparator())) {
       PWSTR path = nullptr;