aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-02 08:52:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-02 08:52:55 +0000
commit2a6ccf6c136ff7f8311b7a1a0e05081b2e872367 (patch)
tree6c6c4c30e87b742887454916832494548f61d6fb /io.c
parenta267b9512afdd66498872484d24542c810f65b99 (diff)
downloadruby-2a6ccf6c136ff7f8311b7a1a0e05081b2e872367.tar.gz
* io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.
r34409 breaks replacing ARGV. [ruby-dev:45160] [Bug #5952] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: