summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Preston <johnprestonmail@gmail.com>2023-09-22 20:16:22 +0400
committerJohn Preston <johnprestonmail@gmail.com>2023-09-22 20:16:22 +0400
commit16b188126826f5d2de30769b139fc1b6343ec391 (patch)
tree08c4aad976d65f33f96fe19fc5c513d17c9d110a
parent0d25b154d9e568e846f0357e68a44de006625192 (diff)
Version 4.10: Fix spawning args on Linux.
-rw-r--r--Telegram/SourceFiles/platform/linux/launcher_linux.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp
index 0a5b8168dc..1e21f57fc8 100644
--- a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp
@@ -54,13 +54,14 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
: (cExeDir() + u"Updater"_q);
argumentsList.push_back(launching.toStdString());
- // argv[0] that is passed to what we are launching.
- const auto argv0 = (justRelaunch && !arguments().isEmpty())
- ? arguments().first()
- : launching;
- argumentsList.push_back(argv0.toStdString());
-
- if (!justRelaunch && cWriteProtected()) {
+ if (justRelaunch) {
+ // argv[0] that is passed to what we are launching.
+ // It should be added explicitly in case of FILE_AND_ARGV_ZERO_.
+ const auto argv0 = !arguments().isEmpty()
+ ? arguments().first()
+ : launching;
+ argumentsList.push_back(argv0.toStdString());
+ } else if (cWriteProtected()) {
// Elevated process that pkexec should launch.
const auto elevated = cWorkingDir() + u"tupdates/temp/Updater"_q;
argumentsList.push_back(elevated.toStdString());