aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index 401b4def..7d15e292 100644
--- a/io.c
+++ b/io.c
@@ -327,10 +327,12 @@ nextfile(IOBUF **curfile, int skipping)
for (; i < (long) (ARGC_node->lnode->numbr); i++) {
tmp = make_number((AWKNUM) i);
- arg = *assoc_lookup(ARGV_node, tmp, FALSE);
+ (void) force_string(tmp);
+ arg = in_array(ARGV_node, tmp);
unref(tmp);
- if (arg->stlen == 0)
+ if (arg == NULL || arg->stlen == 0)
continue;
+ arg = force_string(arg);
arg->stptr[arg->stlen] = '\0';
if (! do_traditional) {
unref(ARGIND_node->var_value);