diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-19 05:56:07 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-19 05:56:07 +0300 |
commit | 4b37168e7672359f1b845c65b529cd35deabbad0 (patch) | |
tree | 05f1a8c2db9464a084ff21077bbe7ac60cfb4741 /eval.c | |
parent | 6df54a8782f6a294fdd40e2bcc021c91b8db219f (diff) | |
parent | 5e8bdc800e2c89e5051c8598faed88f090f8c461 (diff) | |
download | egawk-4b37168e7672359f1b845c65b529cd35deabbad0.tar.gz egawk-4b37168e7672359f1b845c65b529cd35deabbad0.tar.bz2 egawk-4b37168e7672359f1b845c65b529cd35deabbad0.zip |
Merge branch 'master' into feature/cmake
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -930,7 +930,10 @@ set_LINT() int old_lint = do_lint; NODE *n = fixtype(LINT_node->var_value); - lintfunc = r_warning; /* reset to default */ + /* start with clean defaults */ + lintfunc = r_warning; + do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID); + if ((n->flags & STRING) != 0) { const char *lintval; size_t lintlen; @@ -938,20 +941,18 @@ set_LINT() lintval = n->stptr; lintlen = n->stlen; if (lintlen > 0) { - do_flags |= DO_LINT_ALL; - if (lintlen == 5 && strncmp(lintval, "fatal", 5) == 0) - lintfunc = r_fatal; - else if (lintlen == 7 && strncmp(lintval, "invalid", 7) == 0) { - do_flags &= ~DO_LINT_ALL; + if (lintlen == 7 && strncmp(lintval, "invalid", 7) == 0) do_flags |= DO_LINT_INVALID; + else { + do_flags |= DO_LINT_ALL; + if (lintlen == 5 && strncmp(lintval, "fatal", 5) == 0) + lintfunc = r_fatal; } - } else { - do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID); } - } else if (! iszero(n)) - do_flags |= DO_LINT_ALL; - else - do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID); + } else { + if (! iszero(n)) + do_flags |= DO_LINT_ALL; + } /* explicitly use warning() here, in case lintfunc == r_fatal */ if (old_lint != do_lint && old_lint && ! do_lint) |