From d6d20de8b7ff6da6f3d29c5edb0ae3070f997f30 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 6 Aug 2015 04:14:56 -0400 Subject: [PATCH] gawk: fix gensub usage The third arg can either be a string with "g" or "G", or it is a number. The empty string elicits a warning with newer versions like so: gawk: scripts/sysd-rules.awk:56: warning: gensub: third argument `' treated as 1 --- ChangeLog | 5 +++++ nptl/tst-cancel-wrappers.sh | 2 +- scripts/sysd-rules.awk | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b98894da29..38d8d1bce6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-09 Mike Frysinger + + * nptl/tst-cancel-wrappers.sh: Change 3rd arg to gensub to 1. + * scripts/sysd-rules.awk: Likewise. + 2015-08-09 Mike Frysinger * iconvdata/tst-tables.sh: Change echo -n to printf. diff --git a/nptl/tst-cancel-wrappers.sh b/nptl/tst-cancel-wrappers.sh index b2d8302654..d492a541d3 100644 --- a/nptl/tst-cancel-wrappers.sh +++ b/nptl/tst-cancel-wrappers.sh @@ -74,7 +74,7 @@ C["__xpg_sigpause"]=1 seen="" seen_enable="" seen_disable="" - object=gensub(/^.*\[(.*)\]:$/,"\\1","",$0) + object=gensub(/^.*\[(.*)\]:$/, "\\1", 1, $0) next } { diff --git a/scripts/sysd-rules.awk b/scripts/sysd-rules.awk index cc143345c6..cebc9d3e1b 100644 --- a/scripts/sysd-rules.awk +++ b/scripts/sysd-rules.awk @@ -53,7 +53,7 @@ BEGIN { if (target_pattern == "%") { command_suffix = ""; } else { - prefix = gensub(/%/, "", "", target_pattern); + prefix = gensub(/%/, "", 1, target_pattern); command_suffix = " $(" prefix "CPPFLAGS)"; } target = "$(objpfx)" target_pattern o ":";