From b84052135e522d00278d33e0b3d0afbb46e03f51 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 3 Jan 2023 21:19:09 -0500 Subject: [PATCH] gen-strtab.awk: Work around parse issue on HP-UX 11. HP-UX 11 awk seems to have some issues parsing ! in expressions. For example: % awk 'BEGIN { print 1 + !0 }' syntax error The source line is 1. The error context is BEGIN { print 1 + >>> ! <<< 0 } awk: The statement cannot be correctly parsed. The source line is 1. Adding parentheses appers sufficient to avoid the problem: % awk 'BEGIN { print 1 + (!0) }' 2 --- scripts/gen-strtab.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen-strtab.awk b/scripts/gen-strtab.awk index b91736d..7e3de12 100755 --- a/scripts/gen-strtab.awk +++ b/scripts/gen-strtab.awk @@ -177,7 +177,7 @@ END { for (i = 0; i < num_vars; i++) { sep = (i+1) != num_vars ? "," : "" s = vars[i] - o = offsets[strings[s]] + !opts["zero"] + o = offsets[strings[s]] + (!opts["zero"]) print "\t" s " = " o sep if (o > max) { max = o -- 2.43.2