From 4c82793760b88c55ca18cdbdfb819c3ea98cfa91 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 13 Feb 2021 21:51:50 +0200 Subject: Fix assigning to ARGC on command line and add test. --- io.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index c1007423..91c94d9b 100644 --- a/io.c +++ b/io.c @@ -447,7 +447,6 @@ nextfile(IOBUF **curfile, bool skipping) int fd = INVALID_HANDLE; int errcode = 0; IOBUF *iop = *curfile; - long argc; if (skipping) { /* for 'nextfile' call */ errcode = 0; @@ -469,9 +468,7 @@ nextfile(IOBUF **curfile, bool skipping) return 0; } - argc = get_number_si(ARGC_node->var_value); - - for (; i < argc; i++) { + for (; i < get_number_si(ARGC_node->var_value); i++) { tmp = make_number((AWKNUM) i); (void) force_string(tmp); arg = in_array(ARGV_node, tmp); -- cgit v1.2.3