* ext/stringio/stringio.c (strio_read_nonblock): declare local

variables at the first of function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-08-27 04:04:33 +00:00
parent 7c7b005a55
commit 69c8ab256d
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Tue Aug 27 13:03:33 2013 Koichi Sasada <ko1@atdot.net>
* ext/stringio/stringio.c (strio_read_nonblock): declare local
variables at the first of function.
Tue Aug 27 11:51:37 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* enumerator.c: Allow Enumerator size argument to be any callable.

View File

@ -1353,7 +1353,7 @@ strio_sysread(int argc, VALUE *argv, VALUE self)
static VALUE
strio_read_nonblock(int argc, VALUE *argv, VALUE self)
{
VALUE opts = Qnil;
VALUE opts = Qnil, val;
int no_exception = 0;
rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
@ -1365,7 +1365,7 @@ strio_read_nonblock(int argc, VALUE *argv, VALUE self)
no_exception = 1;
}
VALUE val = strio_read(argc, argv, self);
val = strio_read(argc, argv, self);
if (NIL_P(val)) {
if (no_exception)
return Qnil;