diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-19 05:56:32 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-19 05:56:32 +0300 |
commit | 015ef3064c671228262bbaea5a86a675e1b2fa1a (patch) | |
tree | 33baf19ab490e8d5bc0e9d4d7fd1fe8b7e62d6f8 /eval.c | |
parent | c8ea9b44e9957c193137b0fdbbc50dd8af63a2cf (diff) | |
parent | 5e8bdc800e2c89e5051c8598faed88f090f8c461 (diff) | |
download | egawk-015ef3064c671228262bbaea5a86a675e1b2fa1a.tar.gz egawk-015ef3064c671228262bbaea5a86a675e1b2fa1a.tar.bz2 egawk-015ef3064c671228262bbaea5a86a675e1b2fa1a.zip |
Merge branch 'master' into feature/nocopy
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -927,7 +927,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; @@ -935,20 +938,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) |