diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-19 05:55:49 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-19 05:55:49 +0300 |
commit | 5e8bdc800e2c89e5051c8598faed88f090f8c461 (patch) | |
tree | 06478cad1f7fbafdb65ad1910bdf111a8bb6ffb3 /eval.c | |
parent | 6ce601e93b93847ab9d369405cbba624fc1c49bb (diff) | |
parent | 2a92e9d3cb8ba907376837dadd03abc6ad09b741 (diff) | |
download | egawk-5e8bdc800e2c89e5051c8598faed88f090f8c461.tar.gz egawk-5e8bdc800e2c89e5051c8598faed88f090f8c461.tar.bz2 egawk-5e8bdc800e2c89e5051c8598faed88f090f8c461.zip |
Merge branch 'gawk-4.1-stable'
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) |