From b5393701493f43126dabcfebf2b82a794a69bece Mon Sep 17 00:00:00 2001 From: Kathy Brade Date: Tue, 26 Apr 2016 14:25:35 -0400 Subject: [PATCH] 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 54a711000082f..6f38a53d97632 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -394,20 +394,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 -- GitLab