diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 7615c2c7cf75ce58b36fb5d37764125adcd06ba1..8b1b21dab0a62ab4621810f22076ec9cf6b6d51c 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -1342,9 +1342,11 @@ nsresult nsXREDirProvider::AppendFromAppData(nsIFile* aFile, bool aIsDotted) {
   // Similar to nsXREDirProvider::AppendProfilePath.
   // TODO: Bug 1990407 - Evaluate if refactoring might be required there in the
   // future?
-  if (gAppData->profile) {
+  // Use aIsDotted for a different purpose here, will probably break in the future
+  if (gAppData->profile && aIsDotted) {
     nsAutoCString profile;
     profile = gAppData->profile;
+    profile = "."_ns + nsDependentCString(gAppData->profile);
     MOZ_TRY(aFile->AppendRelativeNativePath(profile));
   } else {
     nsAutoCString vendor;
@@ -1354,8 +1356,6 @@ nsresult nsXREDirProvider::AppendFromAppData(nsIFile* aFile, bool aIsDotted) {
     ToLowerCase(vendor);
     ToLowerCase(appName);
 
-    MOZ_TRY(aFile->AppendRelativeNativePath(aIsDotted ? ("."_ns + vendor)
-                                                      : vendor));
     MOZ_TRY(aFile->AppendRelativeNativePath(appName));
   }
 
@@ -1523,13 +1523,8 @@ nsresult nsXREDirProvider::GetLegacyOrXDGHomePath(const char* aHomeDir,
 
     // If the build was made against a specific profile name, MOZ_APP_PROFILE=
     // then make sure we respect this and dont move to XDG directory
-    if (gAppData->profile) {
-      MOZ_TRY(NS_NewNativeLocalFile(nsDependentCString(aHomeDir),
-                                    getter_AddRefs(localDir)));
-    } else {
       MOZ_TRY(GetLegacyOrXDGConfigHome(aHomeDir, getter_AddRefs(localDir)));
       MOZ_TRY(localDir->Clone(getter_AddRefs(parentDir)));
-    }
 
     MOZ_TRY(AppendFromAppData(localDir, false));
   }
