summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/firefox/env_var_for_system_dir-ff86.patch
blob: f7a9cb7734558daf4525e797b7c2542fabf3aa2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff -r 22fc47c968f2 toolkit/xre/nsXREDirProvider.cpp
--- a/toolkit/xre/nsXREDirProvider.cpp	Mon Dec 14 15:09:17 2020 +0000
+++ b/toolkit/xre/nsXREDirProvider.cpp	Tue Feb 23 23:38:56 2021 +0100
@@ -11,6 +11,7 @@
 
 #include "jsapi.h"
 #include "xpcpublic.h"
+#include "prenv.h"
 
 #include "nsIAppStartup.h"
 #include "nsIFile.h"
@@ -305,7 +306,8 @@
       "/usr/lib/mozilla"_ns
 #    endif
       ;
-  rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir));
+  const char* pathVar = PR_GetEnv("MOZ_SYSTEM_DIR");
+  rv = NS_NewNativeLocalFile((pathVar && *pathVar) ? nsDependentCString(pathVar) : reinterpret_cast<const nsCString&>(dirname), false, getter_AddRefs(localDir));
 #  endif
 
   if (NS_SUCCEEDED(rv)) {