Skip to content

Commit 164cf60

Browse files
authored
Wrap everything in outer quotes if arguments are passed
1 parent eeda305 commit 164cf60

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

portable/launchers_src/launcher_template_WINDOWS.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
5757
return 1;
5858
}
5959

60-
// Define the command to run
61-
std::wstring target = L"cmd.exe /c \"" LAUNCH_TARGET L"\"";
62-
63-
// Append arguments if present
60+
// Define the command to run and append arguments if present
61+
std::wstring target;
6462
if (!args.empty()) {
65-
target += args;
63+
target = L"cmd.exe /c \"\"" LAUNCH_TARGET L"\"" + args + L"\"";
64+
} else {
65+
target = L"cmd.exe /c \"" LAUNCH_TARGET L"\"";
6666
}
6767

6868
// Configure the process startup info

0 commit comments

Comments
 (0)