Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9692aa0

Browse files
authored
Wrap everything in outer quotes if arguments are passed
1 parent 2b5d86e commit 9692aa0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

portable/launchers_src/launcher_template_CONSOLE.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ int main() {
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)