diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-05-30 17:07:46 -0400 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-05-30 17:07:46 -0400 |
commit | d851540e8611be939ac01a4f6c87ade351d6ad0b (patch) | |
tree | c6587d5c1db94fc66d47e27762d1973f3282d4ce /ext.c | |
parent | bda71a2e22997e09f82d4ea33ccef03c0afc667b (diff) | |
download | egawk-d851540e8611be939ac01a4f6c87ade351d6ad0b.tar.gz egawk-d851540e8611be939ac01a4f6c87ade351d6ad0b.tar.bz2 egawk-d851540e8611be939ac01a4f6c87ade351d6ad0b.zip |
Allow extension functions to get more arguments than expected.
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -99,7 +99,7 @@ make_builtin(const awk_ext_func_t *funcinfo) const char *sp; char c; const char *name = funcinfo->name; - int count = funcinfo->num_expected_args; + int count = funcinfo->max_expected_args; sp = name; if (sp == NULL || *sp == '\0') @@ -156,10 +156,9 @@ get_argument(int i) INSTRUCTION *pc; pc = TOP()->code_ptr; /* Op_ext_builtin instruction */ - pcount = (pc + 1)->expr_count; /* max # of arguments */ arg_count = pc->expr_count; /* # of arguments supplied */ - if (i < 0 || i >= pcount || i >= arg_count) + if (i < 0 || i >= arg_count) return NULL; t = PEEK(arg_count - i); |