diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-03-31 22:35:15 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-03-31 22:35:15 +0300 |
commit | bbeeb351c73fb1ee4ff20c3774e0477e9e8a7513 (patch) | |
tree | 95f926cd9bf02578e9c860726a56441ac00e95b2 /interpret.h | |
parent | eb53fb0398911202d4361b869eefa6c1449ebec8 (diff) | |
parent | 902b25a40d5cc612dd7a0becb27a5a48afa49716 (diff) | |
download | egawk-bbeeb351c73fb1ee4ff20c3774e0477e9e8a7513.tar.gz egawk-bbeeb351c73fb1ee4ff20c3774e0477e9e8a7513.tar.bz2 egawk-bbeeb351c73fb1ee4ff20c3774e0477e9e8a7513.zip |
Merge branch 'master' into feature/regex-type
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/interpret.h b/interpret.h index 3a9cab37..a11268de 100644 --- a/interpret.h +++ b/interpret.h @@ -1066,7 +1066,15 @@ match_re: assert(the_func != NULL); /* call it */ - r = the_func(arg_count); + if (the_func == (builtin_func_t) do_sub) + r = call_sub(t1->stptr, arg_count); + else if (the_func == do_match) + r = call_match(arg_count); + else if (the_func == do_split || the_func == do_patsplit) + r = call_split_func(t1->stptr, arg_count); + else + r = the_func(arg_count); + PUSH(r); break; } else if (f->type != Node_func) { @@ -1313,17 +1321,18 @@ match_re: fatal(_("`exit' cannot be called in the current context")); exiting = true; - t1 = POP_NUMBER(); - exit_val = (int) get_number_si(t1); - DEREF(t1); + if ((t1 = POP_NUMBER()) != Nnull_string) { + exit_val = (int) get_number_si(t1); #ifdef VMS - if (exit_val == 0) - exit_val = EXIT_SUCCESS; - else if (exit_val == 1) - exit_val = EXIT_FAILURE; - /* else - just pass anything else on through */ + if (exit_val == 0) + exit_val = EXIT_SUCCESS; + else if (exit_val == 1) + exit_val = EXIT_FAILURE; + /* else + just pass anything else on through */ #endif + } + DEREF(t1); if (currule == BEGINFILE || currule == ENDFILE) { |