From e9a39a9a5570986006a9fd052f2e0fb1ace3f94f Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:20:34 +0100 Subject: [PATCH] Changed: Use "open" to open other programs too under OS X --- code/nel/src/misc/common.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 20e03f438..6888dd24f 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -753,25 +753,13 @@ bool launchProgram(const std::string &programName, const std::string &arguments, } #elif defined(NL_OS_MAC) - std::string command; + // we need to open bundles with "open" command + std::string command = NLMISC::toString("open \"%s\"", programName.c_str()); - if (CFile::getExtension(programName) == "app") + // append arguments if any + if (!arguments.empty()) { - // 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 += " " + arguments; + command += NLMISC::toString(" --args %s", arguments.c_str()); } int res = system(command.c_str());