diff options
author | Denys Vlasenko | 2020-06-09 01:33:54 +0200 |
---|---|---|
committer | Denys Vlasenko | 2020-06-09 01:33:54 +0200 |
commit | 6f7a0096496a5a9e90638dc01e947015cc776110 (patch) | |
tree | 9c069ee55413ec7acef2d1e152859b0f14c9b11f /testsuite | |
parent | 45fa3f18adf57ef9d743038743d9c90573aeeb91 (diff) | |
download | busybox-6f7a0096496a5a9e90638dc01e947015cc776110.zip busybox-6f7a0096496a5a9e90638dc01e947015cc776110.tar.gz |
awk: disallow "str"++, closes bug 12981
function old new delta
parse_expr 887 896 +9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index b500829..87f6b50 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -390,5 +390,13 @@ testing 'awk negative field access' \ '' \ 'anything' +# was misinterpreted as (("str"++) i) instead of ("str" (++i)) +# (and was executed: "str"++ is "0", thus concatenating "0" and "1"): +testing 'awk do not allow "str"++' \ + 'awk -v i=1 "BEGIN {print \"str\" ++i}"' \ + "str2\n" \ + '' \ + 'anything' + exit $FAILCOUNT |