From b50ca03e92938c770cbacd44d6ad3e34fde69f95 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Jan 2016 19:16:33 +0100 Subject: [PATCH] Fixed: Use --args only with open --HG-- branch : develop --- code/nel/src/misc/common.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 3f6a5c7b6..8ad3488f6 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -677,7 +677,6 @@ bool abortProgram(uint32 pid) bool launchProgram(const std::string &programName, const std::string &arguments, bool log) { - #ifdef NL_OS_WINDOWS STARTUPINFOA si; PROCESS_INFORMATION pi; @@ -723,16 +722,19 @@ bool launchProgram(const std::string &programName, const std::string &arguments, { // we need to open bundles with "open" command command = NLMISC::toString("open \"%s\"", programName.c_str()); + + // append arguments if any + if (!arguments.empty()) + { + command += NLMISC::toString(" --args %s", arguments.c_str()); + } } else { command = programName; - } - // append arguments if any - if (!arguments.empty()) - { - command += NLMISC::toString(" --args %s", arguments.c_str()); + // append arguments if any + if (!arguments.empty()) command += " " + arguments; } int res = system(command.c_str()); @@ -825,6 +827,7 @@ bool launchProgram(const std::string &programName, const std::string &arguments, #endif return false; +} sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log) {