aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-06-19 15:28:10 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-06-19 15:45:45 +0200
commit97c3b5e3ff252b3399d10835d5c906886a7499f4 (patch)
tree91b0292f8621f48f3a35b5854e99b0998f2e4895 /shell/hush_test
parentfd217c1cbf7a702ad632bb21f7757433de1755b7 (diff)
downloadbusybox-w32-97c3b5e3ff252b3399d10835d5c906886a7499f4.tar.gz
busybox-w32-97c3b5e3ff252b3399d10835d5c906886a7499f4.tar.bz2
busybox-w32-97c3b5e3ff252b3399d10835d5c906886a7499f4.zip
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>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-parsing/bkslash_newline4.right4
-rwxr-xr-xshell/hush_test/hush-parsing/bkslash_newline4.tests14
-rw-r--r--shell/hush_test/hush-vars/var6.right2
3 files changed, 19 insertions, 1 deletions
diff --git a/shell/hush_test/hush-parsing/bkslash_newline4.right b/shell/hush_test/hush-parsing/bkslash_newline4.right
new file mode 100644
index 000000000..2110716d1
--- /dev/null
+++ b/shell/hush_test/hush-parsing/bkslash_newline4.right
@@ -0,0 +1,4 @@
11:1
222:22
33:3
4Ok:0
diff --git a/shell/hush_test/hush-parsing/bkslash_newline4.tests b/shell/hush_test/hush-parsing/bkslash_newline4.tests
new file mode 100755
index 000000000..c8f5037c4
--- /dev/null
+++ b/shell/hush_test/hush-parsing/bkslash_newline4.tests
@@ -0,0 +1,14 @@
1set -- 1 22 333
2echo 1:$\
31
4echo 22:$\
5{\
62\
7}
8echo 3:$\
9{\
10#\
113\
12}
13echo Ok:$\
14?
diff --git a/shell/hush_test/hush-vars/var6.right b/shell/hush_test/hush-vars/var6.right
index 40e67fdf5..5e28d2fab 100644
--- a/shell/hush_test/hush-vars/var6.right
+++ b/shell/hush_test/hush-vars/var6.right
@@ -1,2 +1,2 @@
1hush: invalid number '1q' 1hush: syntax error: unterminated ${name}
2hush: syntax error: unterminated ${name} 2hush: syntax error: unterminated ${name}