pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk/help



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Mar  3 16:47:58 UTC 2019

Modified Files:
        pkgsrc/mk/help: help.awk

Log Message:
mk/help: remove extra empty line when listing all help topics


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 pkgsrc/mk/help/help.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/help/help.awk
diff -u pkgsrc/mk/help/help.awk:1.31 pkgsrc/mk/help/help.awk:1.32
--- pkgsrc/mk/help/help.awk:1.31        Sun Jul 22 06:45:31 2018
+++ pkgsrc/mk/help/help.awk     Sun Mar  3 16:47:58 2019
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.31 2018/07/22 06:45:31 rillig Exp $
+# $NetBSD: help.awk,v 1.32 2019/03/03 16:47:58 rillig Exp $
 #
 
 # This program extracts the inline documentation from *.mk files.
@@ -67,7 +67,8 @@ function end_of_topic() {
        cleanup();
 }
 
-function sorted_keys(array, separator,   elem, list, listlen, i, j, tmp, joined) {
+# Returns the sorted keys of the array, each prefixed by the prefix.
+function sorted_keys(array, prefix,   elem, list, listlen, i, j, tmp, result) {
        listlen = 0;
        for (elem in array)
                list[listlen++] = elem;
@@ -82,11 +83,11 @@ function sorted_keys(array, separator,  
                }
        }
 
-       joined = "";
+       result = "";
        for (i = 0; i < listlen; i++) {
-               joined = joined separator list[i];
+               result = result prefix list[i];
        }
-       return joined;
+       return result;
 }
 
 function cleanup() {
@@ -219,7 +220,6 @@ END {
        end_of_topic();
        if (print_index) {
                print "Available help topics:";
-               print "";
                print sorted_keys(all_keywords, "\n");
        } else if (!found_anything) {
                appearances = sorted_keys(all_appearances, "\n");



Home | Main Index | Thread Index | Old Index