aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-07-19 05:55:49 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-07-19 05:55:49 +0300
commit5e8bdc800e2c89e5051c8598faed88f090f8c461 (patch)
tree06478cad1f7fbafdb65ad1910bdf111a8bb6ffb3 /eval.c
parent6ce601e93b93847ab9d369405cbba624fc1c49bb (diff)
parent2a92e9d3cb8ba907376837dadd03abc6ad09b741 (diff)
downloadegawk-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.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/eval.c b/eval.c
index 5b4418b8..e5c0861a 100644
--- a/eval.c
+++ b/eval.c
@@ -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)