]> git.draconx.ca Git - cdecl99.git/commitdiff
Fix gen-typegen.awk incompatibility with busybox awk.
authorNick Bowler <nbowler@draconx.ca>
Fri, 18 Feb 2022 22:15:34 +0000 (17:15 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 19 Feb 2022 23:23:48 +0000 (18:23 -0500)
It seems that busybox awk does not support * in printf conversions.
There is only one use of this feature in the scripts and we can use
the substr function instead.

test/gen-typegen.awk

index 0ae20f589863880ef126181b657efa8e23586e86..a3a152788b0610eaa8649ccf1eb1ac08120cf6c9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/awk -f
 #
-# Copyright © 2021 Nick Bowler
+# Copyright © 2021-2022 Nick Bowler
 #
 # Generate a mapping from a (random) integer to a list of type specifiers
 # represented by struct cdecl_declspec.  Used internally by declgen to
@@ -53,7 +53,7 @@ END {
 
       printf "\t\t%6s gen_raw_typespec_(%s,\n", prefix, $j
     }
-    printf "\t\t%25sNULL%.*s;\n", "", NF, "))))))))"
+    printf "\t\t%25sNULL%s;\n", "", substr("))))))))", 1, NF);
   }
   print "\tdefault:\n\t\tassert(0);\n\t}"
   print "}\n"