diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2018-12-21 17:38:07 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2018-12-21 17:38:07 -0600 |
| commit | 549db7d3318d8c6479d180fc249ea9b0d6e7b27c (patch) | |
| tree | deeed71e474f4c55dac56fdca5f560709ffe1220 /src/spawn.cpp | |
| parent | 9bc15eb6f7ab73b01a1e500c16473c4b2730c44e (diff) | |
Escape quotes in arguments when elevating MO
Diffstat (limited to 'src/spawn.cpp')
| -rw-r--r-- | src/spawn.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/spawn.cpp b/src/spawn.cpp index f92387d5..6bb34aea 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -159,8 +159,9 @@ HANDLE startBinary(const QFileInfo &binary, "(you will be asked if you want to allow ModOrganizer.exe to make changes to the system)").arg(
QDir::toNativeSeparators(binary.absoluteFilePath())),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ std::wstring parameters = ToWString("\"" + QDir::toNativeSeparators(binary.absoluteFilePath()) + "\" " + QString(arguments).replace("\"", "\\\""));
::ShellExecuteW(nullptr, L"runas", ToWString(QCoreApplication::applicationFilePath()).c_str(),
- (std::wstring(L"\"") + binaryName + L"\" " + ToWString(arguments)).c_str(), currentDirectoryName.c_str(), SW_SHOWNORMAL);
+ parameters.c_str(), currentDirectoryName.c_str(), SW_SHOWNORMAL);
return INVALID_HANDLE_VALUE;
} else {
return INVALID_HANDLE_VALUE;
|
