summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-01 16:53:20 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-01 16:53:20 +0200
commit9bde1c8512de8c93b407ec73c9a10f849043c433 (patch)
tree351f48f15272adf4db0b259a62f624a39ee7d39a
parentb20688a18d57b43e90ae6f219eef34c5ffa99c96 (diff)
downloadMultiMC-9bde1c8512de8c93b407ec73c9a10f849043c433.tar
MultiMC-9bde1c8512de8c93b407ec73c9a10f849043c433.tar.gz
MultiMC-9bde1c8512de8c93b407ec73c9a10f849043c433.tar.lz
MultiMC-9bde1c8512de8c93b407ec73c9a10f849043c433.tar.xz
MultiMC-9bde1c8512de8c93b407ec73c9a10f849043c433.zip
GH-1874 do not pass instance launch args to updated MultiMC
-rw-r--r--application/UpdateController.cpp20
1 files changed, 19 insertions, 1 deletions
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)
{