diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-23 10:53:18 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-23 10:53:18 +0200 |
commit | 2454e678cb7d241097ee9ce4b2114a136f1b57ec (patch) | |
tree | e5a3a5667962c73f43ee8024a2a9152fd45b9577 /testsuite | |
parent | c21dfaf836cf0eb5317035bc20395c751a205934 (diff) | |
download | busybox-w32-2454e678cb7d241097ee9ce4b2114a136f1b57ec.tar.gz busybox-w32-2454e678cb7d241097ee9ce4b2114a136f1b57ec.tar.bz2 busybox-w32-2454e678cb7d241097ee9ce4b2114a136f1b57ec.zip |
awk: do not allow $(-1)
function old new delta
EMSG_NEGATIVE_FIELD - 25 +25
evaluate 3390 3403 +13
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 38/0) Total: 38 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index ad0583afb..3933fefc9 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -339,5 +339,11 @@ testing "awk handles invalid for loop" \ | |||
339 | "awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | 339 | "awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" |
340 | 340 | ||
341 | # testing "description" "command" "result" "infile" "stdin" | 341 | # testing "description" "command" "result" "infile" "stdin" |
342 | testing 'awk negative field access' \ | ||
343 | 'awk 2>&1 -- '\''{ $(-1) }'\' \ | ||
344 | "awk: cmd. line:1: Access to negative field\n" \ | ||
345 | '' \ | ||
346 | 'anything' | ||
347 | |||
342 | 348 | ||
343 | exit $FAILCOUNT | 349 | exit $FAILCOUNT |