]> git.draconx.ca Git - cdecl99.git/blobdiff - test/gen-typegen.awk
Fix gen-typegen.awk incompatibility with busybox awk.
[cdecl99.git] / 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"