Skip to content

Commit

Permalink
gawk: fix gensub usage
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mike Frysinger committed Aug 9, 2015
1 parent 2c61c19 commit d6d20de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2015-08-09 Mike Frysinger <vapier@gentoo.org>

* nptl/tst-cancel-wrappers.sh: Change 3rd arg to gensub to 1.
* scripts/sysd-rules.awk: Likewise.

2015-08-09 Mike Frysinger <vapier@gentoo.org>

* iconvdata/tst-tables.sh: Change echo -n to printf.
Expand Down
2 changes: 1 addition & 1 deletion nptl/tst-cancel-wrappers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ C["__xpg_sigpause"]=1
seen=""
seen_enable=""
seen_disable=""
object=gensub(/^.*\[(.*)\]:$/,"\\1","",$0)
object=gensub(/^.*\[(.*)\]:$/, "\\1", 1, $0)
next
}
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/sysd-rules.awk
Original file line number Diff line number Diff line change
Expand Up @@ -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 ":";
Expand Down

0 comments on commit d6d20de

Please sign in to comment.