Chocobo1 2016-07-16 10:07:48 +08:00 committed by sledgehammer999
parent f2d5ba2907
commit 409e877f8a

View file

@ -266,6 +266,7 @@ void Application::runExternalProgram(BitTorrent::TorrentHandle *const torrent) c
GetSystemDirectoryW(systemPath, sizeof(systemPath) / sizeof(WCHAR));
return QString::fromWCharArray(systemPath) + QLatin1String("\\cmd.exe /C ");
}();
program.prepend(QLatin1String("\"")).append(QLatin1String("\""));
program.prepend(cmdPath);
const uint cmdMaxLength = 32768; // max length (incl. terminate char) for `lpCommandLine` in `CreateProcessW()`
if ((program.size() + 1) > cmdMaxLength) {