0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-05-31 12:52:11 +00:00
Files
termux-packages/x11-packages/thunderbird/0029-prepend-prefix-to-nsXREDirProvider-absolute-paths.patch
Robert Kirkman 2db4c261f9 fix(x11/thunderbird): prepend $TERMUX_PREFIX to some absolute paths found in nsXREDirProvider.cpp
- Like https://github.com/termux/termux-packages/pull/24719, but in `thunderbird`

- I do not know for sure whether there is actually a way to reproduce the problem in `thunderbird`, but the same code is present, so it  should be patched because even if it is currently unusued here, it could hypothetically start being used in the future by something.
2025-05-15 09:25:10 -05:00

30 lines
1.3 KiB
Diff

--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -294,7 +294,7 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
# elif defined(__OpenBSD__) || defined(__FreeBSD__)
"/usr/local/lib/mozilla"_ns
# else
- "/usr/lib/mozilla"_ns
+ "@TERMUX_PREFIX@/lib/mozilla"_ns
# endif
;
rv = NS_NewNativeLocalFile(dirname, getter_AddRefs(localDir));
@@ -400,7 +400,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
# if defined(__OpenBSD__) || defined(__FreeBSD__)
static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions";
# else
- static const char* const sysLExtDir = "/usr/share/mozilla/extensions";
+ static const char* const sysLExtDir = "@TERMUX_PREFIX@/share/mozilla/extensions";
# endif
rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir),
getter_AddRefs(file));
@@ -413,7 +413,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
#endif
} else if (!strcmp(aProperty, XRE_USER_RUNTIME_DIR)) {
#if defined(XP_UNIX)
- nsPrintfCString path("/run/user/%d/%s/", getuid(), GetAppName());
+ nsPrintfCString path("@TERMUX_PREFIX@/var/run/user/%d/%s/", getuid(), GetAppName());
ToLowerCase(path);
rv = NS_NewNativeLocalFile(path, getter_AddRefs(file));
#endif