From 409e877f8a53868b26586592c570b20783a8faf9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 16 Jul 2016 10:07:48 +0800 Subject: [PATCH] Workaround space issues in file path References: https://github.com/qbittorrent/qBittorrent/issues/5439#issuecomment-228616817 https://github.com/qbittorrent/qBittorrent/issues/5439#issuecomment-232214712 --- src/app/application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/application.cpp b/src/app/application.cpp index dd571eab6..2e1a378e2 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -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) {