Commit 126ac71f authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

changed process_t member oargv from type char** to std::vector<char*>

parent 04be33f7
......@@ -749,8 +749,7 @@ processDefArgument(void *vargument)
process_t &process = processSelf();
char *operatorArg;
char *commapos;
int oargc = 0;
char **oargv = process.oargv;
std::vector<char*> &oargv = process.oargv;
int argc = ((argument_t *) vargument)->argc;
std::vector<char *> &argv = ((argument_t *) vargument)->argv;
......@@ -761,22 +760,20 @@ processDefArgument(void *vargument)
if (operatorArg)
{
oargv[oargc++] = operatorArg;
oargv.push_back(operatorArg);
// fprintf(stderr, "processDefArgument: %d %s\n", oargc, operatorArg);
commapos = operatorArg;
while ((commapos = strchr(commapos, ',')) != NULL)
{
*commapos++ = '\0';
*commapos = '\0';
*commapos++;
if (strlen(commapos))
{
if (oargc >= MAX_OARGC)
cdoAbort("Too many parameter (limit=%d)!", MAX_OARGC);
oargv[oargc++] = commapos;
oargv.push_back(commapos);
}
}
process.oargc = oargc;
process.oargc = oargv.size();
}
processDefPrompt(process.operatorName);
......@@ -850,7 +847,7 @@ operatorArgc(void)
char **
operatorArgv(void)
{
return processSelf().oargv;
return &processSelf().oargv[0];
}
void
......
......@@ -67,7 +67,7 @@ class process_t {
const char *operatorName;
char *operatorArg;
int oargc;
char *oargv[MAX_OARGC];
std::vector<char *> oargv;
char prompt[64];
short noper;
oper_t oper[MAX_OPERATOR];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment