From 6f7a0096496a5a9e90638dc01e947015cc776110 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 9 Jun 2020 01:33:54 +0200 Subject: awk: disallow "str"++, closes bug 12981 function old new delta parse_expr 887 896 +9 Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testsuite') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index b5008290f..87f6b5007 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 -- cgit v1.2.3