Received: by mail.netbsd.org (Postfix, from userid 605) id 0B05D84D48; Sun, 3 May 2020 10:57:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 87AB084D5D for ; Sun, 3 May 2020 10:57:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id LQmuzln8ouka for ; Sun, 3 May 2020 10:57:07 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id DE4D484D02 for ; Sun, 3 May 2020 10:57:06 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id D6AB8FB27; Sun, 3 May 2020 10:57:06 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_158850342626010" MIME-Version: 1.0 Date: Sun, 3 May 2020 10:57:06 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/mk/help To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20200503105706.D6AB8FB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_158850342626010 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun May 3 10:57:06 UTC 2020 Modified Files: pkgsrc/mk/help: help.awk Log Message: mk/help: clean up code To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 pkgsrc/mk/help/help.awk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_158850342626010 Content-Disposition: inline Content-Length: 1119 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/help/help.awk diff -u pkgsrc/mk/help/help.awk:1.40 pkgsrc/mk/help/help.awk:1.41 --- pkgsrc/mk/help/help.awk:1.40 Sun May 3 10:51:06 2020 +++ pkgsrc/mk/help/help.awk Sun May 3 10:57:06 2020 @@ -1,4 +1,4 @@ -# $NetBSD: help.awk,v 1.40 2020/05/03 10:51:06 rillig Exp $ +# $NetBSD: help.awk,v 1.41 2020/05/03 10:57:06 rillig Exp $ # # This program extracts the inline documentation from *.mk files. @@ -36,7 +36,7 @@ BEGIN { # end of a file or by the end of all files. When there have been enough # comment lines, the topic is considered worth printing. # -function end_of_topic( relevant, has_keywords, skip_reason) { +function end_of_topic( skip_reason, k, relevant, i) { skip_reason = \ array_is_empty(keywords) \ @@ -118,13 +118,10 @@ function dprint_skip(word, reason) { print(FILENAME ":" FNR ": \"" word "\" is no keyword because " reason); } -function array_is_empty(arr, i, empty) { - empty = yes; - for (i in arr) { - empty = no; - break; - } - return empty; +function array_is_empty(arr, i) { + for (i in arr) + return no; + return yes; } { --_----------=_158850342626010--