hush: fix bkslash+newline handling and number validation in ${NN} and ${#NN}

Entering "${1a}" into interactive shell was making it exit.

function                                             old     new   delta
parse_dollar                                         824     958    +134
i_getch_and_eat_bkslash_nl                             -      44     +44
parse_expr                                           917     938     +21
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 199/0)             Total: 199 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-06-19 15:28:10 +02:00
parent fd217c1cbf
commit 97c3b5e3ff
6 changed files with 64 additions and 2 deletions

View File

@@ -1,2 +1,2 @@
hush: invalid number '1q'
hush: syntax error: unterminated ${name}
hush: syntax error: unterminated ${name}