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>
This commit is contained in:
@@ -339,5 +339,11 @@ testing "awk handles invalid for loop" \
|
||||
"awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" ""
|
||||
|
||||
# testing "description" "command" "result" "infile" "stdin"
|
||||
testing 'awk negative field access' \
|
||||
'awk 2>&1 -- '\''{ $(-1) }'\' \
|
||||
"awk: cmd. line:1: Access to negative field\n" \
|
||||
'' \
|
||||
'anything'
|
||||
|
||||
|
||||
exit $FAILCOUNT
|
||||
|
Reference in New Issue
Block a user