#172: using vector of strings in SplitCommandLine

instead of dynamic array of c-style strings.
This commit is contained in:
Andrey Prygunkov
2016-02-23 22:07:30 +01:00
parent cdf6068db5
commit 548753aa69
8 changed files with 23 additions and 49 deletions

View File

@@ -32,8 +32,8 @@
void SchedulerScriptController::StartScript(const char* param, bool externalProcess, int taskId)
{
char** argv = nullptr;
if (externalProcess && !Util::SplitCommandLine(param, &argv))
std::vector<CString> argv;
if (externalProcess && (argv = Util::SplitCommandLine(param)).empty())
{
error("Could not execute scheduled process-script, failed to parse command line: %s", param);
return;
@@ -48,7 +48,8 @@ void SchedulerScriptController::StartScript(const char* param, bool externalProc
if (externalProcess)
{
scriptController->SetScript(argv[0]);
scriptController->SetArgs((const char**)argv, true);
scriptController->m_args = std::move(argv);
scriptController->SetArgs((const char**)scriptController->m_args.data(), false);
}
scriptController->SetAutoDestroy(true);