From 0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 30 May 2023 16:42:18 +0200 Subject: awk: fix precedence of = relative to == Discovered while adding code to disallow assignments to non-lvalues function old new delta parse_expr 936 991 +55 .rodata 105243 105247 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 59/0) Total: 59 bytes Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testsuite') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 8ab1c6891..cdab93d21 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -547,4 +547,9 @@ testing 'awk does not split on CR (char 13)' \ 'word1 word2 word3\r word2 word3\r\n' \ '' 'word1 word2 word3\r' +testing "awk = has higher precedence than == (despite what gawk manpage claims)" \ + "awk 'BEGIN { v=1; print 2==v; print 2==v=2; print v; print v=3==3; print v}'" \ + '0\n1\n2\n1\n3\n' \ + '' '' + exit $FAILCOUNT -- cgit v1.2.3