libncurses: Import https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz changes

Change-Id: I3433d30ca01359fd2e3623ede96b531f0b39cbfa
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/mk-hdr.awk b/mk-hdr.awk
index dfb2c9a..7608afe 100644
--- a/mk-hdr.awk
+++ b/mk-hdr.awk
@@ -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.8 2021/06/17 21:20:30 tom Exp $
 ##############################################################################
-# Copyright (c) 2007-2010,2013 Free Software Foundation, Inc.                #
+# 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    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -38,6 +39,13 @@
 	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
@@ -47,7 +55,7 @@
 		using = 0
 		if (subset == "none") {
 			using = 1
-		} else if (index(subset,$2) > 0) {
+		} else if (in_subset($2) > 0) {
 			using = 1
 		} else {
 			using = 0
@@ -61,8 +69,8 @@
 			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
 			}