iocsh trap arg. parsing errors

This commit is contained in:
Michael Davidsaver
2019-06-23 19:43:34 -07:00
parent 52b9c8b947
commit a81e261e23
+3 -1
View File
@@ -868,6 +868,9 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
* Set up redirection
*/
if ((openRedirect(filename, lineno, redirects) == 0) && (argc > 0)) {
// error unless a function is actually called.
// handles command not-found and arg parsing errors.
scope.errored = true;
/*
* Look up command
*/
@@ -924,7 +927,6 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
}
else {
showError(filename, lineno, "Command %s not found.", argv[0]);
scope.errored = true;
}
}
stopRedirect(filename, lineno, redirects);