]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - mk-hdr.awk
ncurses 6.2 - patch 20200829
[ncurses.git] / mk-hdr.awk
index dfb2c9a29489c366684c927f63e571784a6a5fbc..b4b9e72344f06b9d7e3e3a00230d8cfe7dea1983 100644 (file)
@@ -1,6 +1,7 @@
-# $Id: mk-hdr.awk,v 1.4 2013/08/03 23:09:42 tom Exp $
+# $Id: mk-hdr.awk,v 1.6 2020/08/29 22:07:18 tom Exp $
 ##############################################################################
-# Copyright (c) 2007-2010,2013 Free Software Foundation, Inc.                #
+# Copyright 2020 Thomas E. Dickey                                            #
+# Copyright 2007-2010,2013 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -38,6 +39,14 @@ function basename(path) {
        sub(/^.*\//,"",path)
        return path;
 }
+function in_subset(value) {
+       value = " " value " ";
+       check = subset;
+       sub(" .*$", "", check);
+       gsub("[+]", " ", check);
+       check = " " check " ";
+       return index(check,value);
+}
 BEGIN  {
                found = 0
                using = 1
@@ -47,7 +56,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