From 9bde1c8512de8c93b407ec73c9a10f849043c433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 1 May 2017 16:53:20 +0200 Subject: GH-1874 do not pass instance launch args to updated MultiMC --- application/UpdateController.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'application') diff --git a/application/UpdateController.cpp b/application/UpdateController.cpp index e3d8f2fb..8df5b3fc 100644 --- a/application/UpdateController.cpp +++ b/application/UpdateController.cpp @@ -273,8 +273,26 @@ void UpdateController::installUpdates() } } + // FIXME: reparse args and construct a safe variant from scratch. This is a workaround for GH-1874: + QStringList realargs; + int skip = 0; + for(auto & arg: args) + { + if(skip) + { + skip--; + continue; + } + if(arg == "-l") + { + skip = 1; + continue; + } + realargs.append(arg); + } + // start the updated application - started = QProcess::startDetached(finishCmd, args, QDir::currentPath(), &pid); + started = QProcess::startDetached(finishCmd, realargs, QDir::currentPath(), &pid); // much dumber check - just find out if the call if(!started || pid == -1) { -- cgit v1.2.3