diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-12-06 22:00:44 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-12-06 22:00:44 +0200 |
commit | 3ba2f61ff006c308a904c8b1a4bc433082ce87c8 (patch) | |
tree | 634e529b16d2d8ea6b3655172f58d35e014edcb0 /eval.c | |
parent | 1527865d3c430aa203ed23fa7ecbeea30a604724 (diff) | |
download | egawk-3ba2f61ff006c308a904c8b1a4bc433082ce87c8.tar.gz egawk-3ba2f61ff006c308a904c8b1a4bc433082ce87c8.tar.bz2 egawk-3ba2f61ff006c308a904c8b1a4bc433082ce87c8.zip |
Misc fixes from John.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2507,7 +2507,7 @@ func_call: break; case Op_K_getline: /* no redirection */ - if (currule == BEGINFILE || currule == ENDFILE) + if (! currule || currule == BEGINFILE || currule == ENDFILE) fatal(_("non-redirected `getline' invalid inside `%s' rule"), ruletab[currule]); @@ -2654,6 +2654,12 @@ func_call: break; case Op_K_exit: + /* exit not allowed in user-defined comparison functions for "sorted_in"; + * This is done so that END blocks aren't executed more than once. + */ + if (! currule) + fatal(_("`exit' cannot be called in the current context")); + exiting = TRUE; POP_NUMBER(x1); exit_val = (int) x1; |