aboutsummaryrefslogtreecommitdiffstats
path: root/field.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-09-18 11:37:02 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-09-18 11:37:02 +0300
commitf2230060d3301f83f1223983a8ee942328c6e0c4 (patch)
tree3354868043859941b7fc5a38cd84a47dcc7f954c /field.c
parenta3bfee4ed115a19a968568b9e2abdca2563bfb10 (diff)
downloadegawk-f2230060d3301f83f1223983a8ee942328c6e0c4.tar.gz
egawk-f2230060d3301f83f1223983a8ee942328c6e0c4.tar.bz2
egawk-f2230060d3301f83f1223983a8ee942328c6e0c4.zip
Improve lint check for accessing fields in END rule.
Diffstat (limited to 'field.c')
-rw-r--r--field.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/field.c b/field.c
index 1c209c26..b7723aa5 100644
--- a/field.c
+++ b/field.c
@@ -832,18 +832,19 @@ NODE **
get_field(long requested, Func_ptr *assign)
{
bool in_middle = false;
+ static bool warned = false;
+ extern int currule;
+
+ if (do_lint && currule == END && ! warned) {
+ warned = true;
+ lintwarn(_("accessing fields from an END rule may not be portable"));
+ }
+
/*
* if requesting whole line but some other field has been altered,
* then the whole line must be rebuilt
*/
if (requested == 0) {
- static bool warned = false;
- extern int currule;
-
- if (do_lint && currule == END && ! warned) {
- warned = true;
- lintwarn(_("accessing $0 from an END rule may not be portable"));
- }
if (! field0_valid) {
/* first, parse remainder of input record */
if (NF == -1) {