diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | field.c | 10 |
2 files changed, 8 insertions, 7 deletions
@@ -1,3 +1,8 @@ +2017-10-14 Arnold D. Robbins <arnold@skeeve.com> + + * field.c (do_split): Simplify the lint warnings. + Based on suggested code by Eric Pruitt <eric.pruitt@gmail.com>. + 2017-10-08 Arnold D. Robbins <arnold@skeeve.com> * command.y: Fix the FSF's address. @@ -946,7 +946,7 @@ do_split(int nargs) Regexp *rp = NULL; if (nargs == 4) { - static bool warned1 = false, warned2 = false; + static bool warned = false; if (do_traditional || do_posix) { fatal(_("split: fourth argument is a gawk extension")); @@ -954,14 +954,10 @@ do_split(int nargs) sep_arr = POP_PARAM(); if (sep_arr->type != Node_var_array) fatal(_("split: fourth argument is not an array")); - if (do_lint && ! warned1) { - warned1 = true; + if ((do_lint || do_lint_old) && ! warned) { + warned = true; lintwarn(_("split: fourth argument is a gawk extension")); } - if (do_lint_old && ! warned2) { - warned2 = true; - warning(_("split: fourth argument is a gawk extension")); - } } sep = POP(); |