aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-12-06 22:00:44 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-12-06 22:00:44 +0200
commit3ba2f61ff006c308a904c8b1a4bc433082ce87c8 (patch)
tree634e529b16d2d8ea6b3655172f58d35e014edcb0 /eval.c
parent1527865d3c430aa203ed23fa7ecbeea30a604724 (diff)
downloadegawk-3ba2f61ff006c308a904c8b1a4bc433082ce87c8.tar.gz
egawk-3ba2f61ff006c308a904c8b1a4bc433082ce87c8.tar.bz2
egawk-3ba2f61ff006c308a904c8b1a4bc433082ce87c8.zip
Misc fixes from John.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index cd5a5844..22f30773 100644
--- a/eval.c
+++ b/eval.c
@@ -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;