Commit 32f8c6cc authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

fixed bug with wildcrads, now processed input like -info [ [ f1 f2 f3 ] ] does not cause errors

parent 3100b70f
Pipeline #5067 passed with stages
in 18 minutes and 54 seconds
......@@ -278,7 +278,7 @@ ProcessManager::createProcessesFromInput(int argc, const char **argv)
Process *currentProcess;
std::stack<Process *> processStack;
std::set<Process *> bracketOperators;
std::vector<Process *> bracketOperators;
const char *argvEntry;
int unclosedBrackets = 0;
unsigned int idx = 1;
......@@ -309,7 +309,7 @@ ProcessManager::createProcessesFromInput(int argc, const char **argv)
else if (argvEntry[0] == '[')
{
checkSingleBracketOnly(argvEntry, '[');
bracketOperators.insert(currentProcess);
bracketOperators.push_back(currentProcess);
unclosedBrackets++;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -318,8 +318,10 @@ ProcessManager::createProcessesFromInput(int argc, const char **argv)
{
checkSingleBracketOnly(argvEntry, ']');
unclosedBrackets--;
bracketOperators.erase(processStack.top());
processStack.pop();
bracketOperators.pop_back();
//this check is for double bracktets like -info [ [ file1 file2 file3 ] ] which can happen when cdo wildcards are used.
auto it = std::find(bracketOperators.begin(), bracketOperators.end(), processStack.top());
if (it == bracketOperators.end()) processStack.pop();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// case: file
......@@ -332,14 +334,15 @@ ProcessManager::createProcessesFromInput(int argc, const char **argv)
}
else
{
parse_err_msg += std::string(argvEntry) + " is used as an output, files can not be used as in- and output at the same time";
parse_err_msg
+= std::string(argvEntry) + " is used as an output, files can not be used as in- and output at the same time";
return ParseStatus::FileIsInAndOutput;
}
}
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
// remove finished
while (!processStack.empty() && processStack.top()->hasAllInputs()
&& bracketOperators.find(processStack.top()) == bracketOperators.end())
&& std::find(bracketOperators.begin(), bracketOperators.end(),processStack.top()) == bracketOperators.end())
{
Debug(PROCESS_MANAGER, "Removing %s from stack", processStack.top()->operatorName);
processStack.pop();
......
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