X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=mk-2nd.awk;h=3fe7ed3d22a0d55f9da8577e8b2f836bf03e981e;hp=1f637635228afae72e50896b6b1b9b26fa3be900;hb=b724cdc89cf31757ab43262ecefe5242b0edc450;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8;ds=sidebyside diff --git a/mk-2nd.awk b/mk-2nd.awk index 1f637635..3fe7ed3d 100644 --- a/mk-2nd.awk +++ b/mk-2nd.awk @@ -1,6 +1,7 @@ -# $Id: mk-2nd.awk,v 1.19 2005/01/22 16:30:04 tom Exp $ +# $Id: mk-2nd.awk,v 1.22 2020/08/31 23:49:17 tom Exp $ ############################################################################## -# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. # +# Copyright 2020 Thomas E. Dickey # +# Copyright 1998-2004,2005 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"), # @@ -52,6 +53,13 @@ # # Fields in src/modules past $3 are dependencies # +function in_subset(value) { + value = " " value " "; + check = subset; + gsub("[+]", " ", check); + check = " " check " "; + return index(check,value); + } BEGIN { found = 0 using = 0 @@ -60,7 +68,7 @@ BEGIN { using = 0 if (subset == "none") { using = 1 - } else if (index(subset,$2) > 0) { + } else if (in_subset($2) > 0) { if (using == 0) { if (found == 0) { print ""