app-portage/eclass-manpages: fix gensub warnings
authorMike Frysinger <vapier@gentoo.org>
Fri, 14 Aug 2015 04:03:32 +0000 (00:03 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 14 Aug 2015 04:05:36 +0000 (00:05 -0400)
Newer gawk warns when you use an empty string with the 3rd arg to gensub
since that only accepts "g", "G", or a number.

app-portage/eclass-manpages/files/eclass-to-manpage.awk

index ee428107500466555f5d2f82e3ca9075de48e6ad..979ad10a6a8805ce48cdb6f8ac6b045c8905c272 100644 (file)
@@ -294,12 +294,12 @@ function _handle_variable() {
        # first try var="val"
        op = "="
        regex = "^.*" var_name "=(.*)$"
-       val = gensub(regex, "\\1", "", $0)
+       val = gensub(regex, "\\1", 1, $0)
        if (val == $0) {
                # next try : ${var:=val}
                op = "?="
                regex = "^[[:space:]]*:[[:space:]]*[$]{" var_name ":?=(.*)}"
-               val = gensub(regex, "\\1", "", $0)
+               val = gensub(regex, "\\1", 1, $0)
                if (val == $0) {
                        if (default_unset + required + internal == 0)
                                warn(var_name ": unable to extract default variable content: " $0)
@@ -367,7 +367,7 @@ function handle_footer() {
        print ".BR " eclassdir "/" eclass
        print ".SH \"SEE ALSO\""
        print ".BR ebuild (5)"
-       print pre_text(gensub("@ECLASS@", eclass, "", vcs_url))
+       print pre_text(gensub("@ECLASS@", eclass, 1, vcs_url))
 }
 
 #