[tbb-commits] [tor-browser/tor-browser-45.1.0esr-6.0-1] Bug 18900: updater doesn't work on Linux (cannot find libraries)

gk at torproject.org gk at torproject.org
Tue Apr 26 21:05:25 UTC 2016


commit 82cfa7c8786c1ad1421666365bd71f3594861328
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Tue Apr 26 14:25:35 2016 -0400

    Bug 18900: updater doesn't work on Linux (cannot find libraries)
    
    Revert "Bug 1159090 - Only append library path for updater if it is a unique value. r=rstrong"
    
    This reverts commit 5c4fcaf37f8e479b5d3c46a21b8a48ad1fe567d8.
---
 toolkit/xre/nsUpdateDriver.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp
index 0c7b6b0..d256f2a 100644
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -488,20 +488,20 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir, nsIFile *appDir, nsIFile *updateDir,
 static void
 AppendToLibPath(const char *pathToAppend)
 {
+  char *s = nullptr;
   char *pathValue = getenv(LD_LIBRARY_PATH_ENVVAR_NAME);
   if (nullptr == pathValue || '\0' == *pathValue) {
-    char *s = PR_smprintf("%s=%s", LD_LIBRARY_PATH_ENVVAR_NAME, pathToAppend);
-    PR_SetEnv(s);
-  } else if (!strstr(pathValue, pathToAppend)) {
-    char *s = PR_smprintf("%s=%s" PATH_SEPARATOR "%s",
+    s = PR_smprintf("%s=%s", LD_LIBRARY_PATH_ENVVAR_NAME, pathToAppend);
+  } else {
+    s = PR_smprintf("%s=%s" PATH_SEPARATOR "%s",
                     LD_LIBRARY_PATH_ENVVAR_NAME, pathToAppend, pathValue);
-    PR_SetEnv(s);
   }
 
   // The memory used by PR_SetEnv is not copied to the environment on all
   // platform, it can be used by reference directly. So we purposely do not
   // call PR_smprintf_free on s.  Subsequent calls to PR_SetEnv will free
   // the old memory first.
+  PR_SetEnv(s);
 }
 #endif
 



More information about the tbb-commits mailing list