From fd65872de3b2ca439b06065363beec58d4276c82 Mon Sep 17 00:00:00 2001 From: probonopd Date: Thu, 8 Sep 2016 21:52:00 +0200 Subject: [PATCH] Allow binaries in the usr/bin subdirectory to be found --- linuxdeployqt/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index d8da78d..2641e37 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -27,7 +27,7 @@ ****************************************************************************/ #include #include - +#include #include "../shared/shared.h" int main(int argc, char **argv) @@ -69,8 +69,10 @@ int main(int argc, char **argv) // Allow binaries in the usr/bin subdirectory to be found; this is useful for bundling // this application itself together with helper binaries such as patchelf + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); QString pathToUsrBin = QCoreApplication::applicationDirPath()+ "/usr/bin"; - setenv("PATH",pathToUsrBin.toUtf8().constData(),1); + QString oldPath = env.value("PATH"); + env.insert("PATH", pathToUsrBin + ":" + oldPath); QString appName = QDir::cleanPath(QFileInfo(appBinaryPath).completeBaseName()); @@ -199,3 +201,4 @@ int main(int argc, char **argv) return 0; } +