summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-09 05:12:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-09 05:12:29 +0000
commit77df5c7db4512928a60d9357894d84fb24a62269 (patch)
treedf67ee03a34c524b26aebc2201a5c5fb63b25b76 /io.c
parentecf298f30f946990f1a61cdc80cb16393b3fde8d (diff)
downloadruby-77df5c7db4512928a60d9357894d84fb24a62269.tar.gz
ruby-77df5c7db4512928a60d9357894d84fb24a62269.tar.xz
ruby-77df5c7db4512928a60d9357894d84fb24a62269.zip
* io.c (rb_f_select): IO list could be altered. [ruby-dev:25312]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io.c b/io.c
index 9c2fcddf6..b2496b7b1 100644
--- a/io.c
+++ b/io.c
@@ -4597,7 +4597,7 @@ rb_f_select(argc, argv, obj)
GetOpenFile(rb_io_get_io(RARRAY(read)->ptr[i]), fptr);
if (FD_ISSET(fptr->fd, rp)
|| FD_ISSET(fptr->fd, &pset)) {
- rb_ary_push(list, RARRAY(read)->ptr[i]);
+ rb_ary_push(list, rb_ary_entry(read, i));
}
}
}
@@ -4607,7 +4607,7 @@ rb_f_select(argc, argv, obj)
for (i=0; i< RARRAY(write)->len; i++) {
GetOpenFile(rb_io_get_io(RARRAY(write)->ptr[i]), fptr);
if (FD_ISSET(fptr->fd, wp)) {
- rb_ary_push(list, RARRAY(write)->ptr[i]);
+ rb_ary_push(list, rb_ary_entry(write, i));
}
}
}
@@ -4617,7 +4617,7 @@ rb_f_select(argc, argv, obj)
for (i=0; i< RARRAY(except)->len; i++) {
GetOpenFile(rb_io_get_io(RARRAY(except)->ptr[i]), fptr);
if (FD_ISSET(fptr->fd, ep)) {
- rb_ary_push(list, RARRAY(except)->ptr[i]);
+ rb_ary_push(list, rb_ary_entry(except, i));
}
}
}