shell: fix double syntax errors aborting program
Type e.g. "e 1 + 2 * 3". The first "+" throws a syntax error (parentheses are needed around expressions) and the "*" another one during the final exhaust_until_separator phase, which wasn't protected by a try/catch.
This commit is contained in:
parent
44babe3baf
commit
0f23fec85d
|
@ -424,7 +424,15 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
/* Exhaust command input (if not all used by the command) */
|
||||
parser.exhaust_until_separator();
|
||||
while(true) {
|
||||
try {
|
||||
parser.exhaust_until_separator();
|
||||
break;
|
||||
}
|
||||
catch(std::exception &e) {
|
||||
FxOS_log(ERR, "%s", e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Save command history */
|
||||
|
|
Loading…
Reference in New Issue