mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-16 14:28:43 +00:00
Fixed: Use --args only with open
This commit is contained in:
parent
b420542ff4
commit
3f9471aee8
1 changed files with 9 additions and 6 deletions
|
@ -677,7 +677,6 @@ bool abortProgram(uint32 pid)
|
||||||
|
|
||||||
bool launchProgram(const std::string &programName, const std::string &arguments, bool log)
|
bool launchProgram(const std::string &programName, const std::string &arguments, bool log)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
STARTUPINFOA si;
|
STARTUPINFOA si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
@ -723,17 +722,20 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
|
||||||
{
|
{
|
||||||
// we need to open bundles with "open" command
|
// we need to open bundles with "open" command
|
||||||
command = NLMISC::toString("open \"%s\"", programName.c_str());
|
command = NLMISC::toString("open \"%s\"", programName.c_str());
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
command = programName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// append arguments if any
|
// append arguments if any
|
||||||
if (!arguments.empty())
|
if (!arguments.empty())
|
||||||
{
|
{
|
||||||
command += NLMISC::toString(" --args %s", arguments.c_str());
|
command += NLMISC::toString(" --args %s", arguments.c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
command = programName;
|
||||||
|
|
||||||
|
// append arguments if any
|
||||||
|
if (!arguments.empty()) command += " " + arguments;
|
||||||
|
}
|
||||||
|
|
||||||
int res = system(command.c_str());
|
int res = system(command.c_str());
|
||||||
|
|
||||||
|
@ -825,6 +827,7 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log)
|
sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue