X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=mk-hdr.awk;h=7608afedb01e877e078e183a2cb3c9447a058edf;hp=377b1c3c9e8c188b0ceddf335da8203a9ff869e3;hb=9b51794524995304d8788e42aacb36feede9364f;hpb=47d2fb4537d9ad5bb14f4810561a327930ca4280 diff --git a/mk-hdr.awk b/mk-hdr.awk index 377b1c3c..7608afed 100644 --- a/mk-hdr.awk +++ b/mk-hdr.awk @@ -1,6 +1,6 @@ -# $Id: mk-hdr.awk,v 1.5 2020/02/02 23:34:34 tom Exp $ +# $Id: mk-hdr.awk,v 1.8 2021/06/17 21:20:30 tom Exp $ ############################################################################## -# Copyright 2020 Thomas E. Dickey # +# Copyright 2020,2021 Thomas E. Dickey # # Copyright 2007-2010,2013 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -39,6 +39,13 @@ function basename(path) { sub(/^.*\//,"",path) return path; } +function in_subset(value) { + value = " " value " "; + check = subset; + gsub("[+]", " ", check); + check = " " check " "; + return index(check,value); +} BEGIN { found = 0 using = 1 @@ -48,7 +55,7 @@ BEGIN { using = 0 if (subset == "none") { using = 1 - } else if (index(subset,$2) > 0) { + } else if (in_subset($2) > 0) { using = 1 } else { using = 0 @@ -62,8 +69,8 @@ BEGIN { if (found == 0) { print "" print "# generated by mk-hdr.awk" - printf "# subset: %s\n", subset - printf "# compat: %s\n", compat + printf "# subset: %s\n", subset + printf "# compat: %s\n", compat print "" found = 1 }