added command line, added basic character
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "tier1/utlvector.h"
|
||||
#include "unistd.h"
|
||||
#include "sys/wait.h"
|
||||
#include "tier1/commandline.h"
|
||||
int IRunner::Run(CUtlString szName, CUtlVector<CUtlString>& args)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
@@ -14,10 +15,16 @@ int IRunner::Run(CUtlString szName, CUtlVector<CUtlString>& args)
|
||||
{
|
||||
CUtlVector<const char*> execargs;
|
||||
execargs.AppendTail(szName);
|
||||
if (ICommandLine::CheckParam("-fpcdebug"))
|
||||
V_printf("%s",szName.GetString());
|
||||
for (auto &arg: args)
|
||||
{
|
||||
execargs.AppendTail(arg);
|
||||
if (ICommandLine::CheckParam("-fpcdebug"))
|
||||
V_printf(" %s",arg.GetString());
|
||||
}
|
||||
if (ICommandLine::CheckParam("-fpcdebug"))
|
||||
V_printf("\n");
|
||||
execargs.AppendTail(0);
|
||||
execvp(szName, (char *const*)execargs.GetData());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user