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:
Lephenixnoir 2023-08-20 18:12:13 +02:00
parent 44babe3baf
commit 0f23fec85d
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 9 additions and 1 deletions

View File

@ -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 */