diff options
author | Denys Vlasenko | 2024-02-25 17:50:43 +0100 |
---|---|---|
committer | Denys Vlasenko | 2024-02-25 17:53:25 +0100 |
commit | 758b21402abc7015cfc54eb21a2e7eead1ecf6ba (patch) | |
tree | dce318909aa47fa4abbb3d9f68fbc64b0c9cd795 /shell/hush_test | |
parent | 2639f3bc72ac2f03af7ccc825429ccb2fce99a16 (diff) | |
download | busybox-758b21402abc7015cfc54eb21a2e7eead1ecf6ba.zip busybox-758b21402abc7015cfc54eb21a2e7eead1ecf6ba.tar.gz |
hush: detect when terminating "done"/"fi" is missing
function old new delta
parse_stream 2271 2292 +21
.rodata 105408 105427 +19
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 40/0) Total: 40 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-parsing/nodone1.right | 1 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/nodone1.tests | 1 | ||||
-rw-r--r-- | shell/hush_test/hush-parsing/nodone2.right | 1 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/nodone2.tests | 3 |
4 files changed, 6 insertions, 0 deletions
diff --git a/shell/hush_test/hush-parsing/nodone1.right b/shell/hush_test/hush-parsing/nodone1.right new file mode 100644 index 0000000..3dc1bcf --- /dev/null +++ b/shell/hush_test/hush-parsing/nodone1.right @@ -0,0 +1 @@ +hush: syntax error: unterminated compound statement diff --git a/shell/hush_test/hush-parsing/nodone1.tests b/shell/hush_test/hush-parsing/nodone1.tests new file mode 100755 index 0000000..de286c5 --- /dev/null +++ b/shell/hush_test/hush-parsing/nodone1.tests @@ -0,0 +1 @@ +for i; do : diff --git a/shell/hush_test/hush-parsing/nodone2.right b/shell/hush_test/hush-parsing/nodone2.right new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/shell/hush_test/hush-parsing/nodone2.right @@ -0,0 +1 @@ +1 diff --git a/shell/hush_test/hush-parsing/nodone2.tests b/shell/hush_test/hush-parsing/nodone2.tests new file mode 100755 index 0000000..69537b3 --- /dev/null +++ b/shell/hush_test/hush-parsing/nodone2.tests @@ -0,0 +1,3 @@ +for i in 1; do echo $i +# the next line has no EOL. It still must count as "done" keyword: +done
\ No newline at end of file |