aboutsummaryrefslogtreecommitdiffstats
path: root/ext.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-05-30 17:07:46 -0400
committerArnold D. Robbins <arnold@skeeve.com>2016-05-30 17:07:46 -0400
commitd851540e8611be939ac01a4f6c87ade351d6ad0b (patch)
treec6587d5c1db94fc66d47e27762d1973f3282d4ce /ext.c
parentbda71a2e22997e09f82d4ea33ccef03c0afc667b (diff)
downloadegawk-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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext.c b/ext.c
index c16ab60a..c0d6f150 100644
--- a/ext.c
+++ b/ext.c
@@ -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);