summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/io.c b/io.c
index 4bf65d9bdf..7bf5543d62 100644
--- a/io.c
+++ b/io.c
@@ -7306,6 +7306,14 @@ argf_next_argv(VALUE argf)
}
ARGF.init_p = 1;
}
+ else {
+ if (NIL_P(ARGF.argv)) {
+ ARGF.next_p = -1;
+ }
+ else if (ARGF.next_p == -1 && RARRAY_LEN(ARGF.argv) > 0) {
+ ARGF.next_p = 1;
+ }
+ }
if (ARGF.next_p == 1) {
retry: