From 69c8ab256d8e3609dec98a763288b87cd1278f6b Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 27 Aug 2013 04:04:33 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ ext/stringio/stringio.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0af5098b6..f9cb8ad4e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 27 13:03:33 2013 Koichi Sasada + + * 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 * enumerator.c: Allow Enumerator size argument to be any callable. diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 5c2c64ca03..ebf678bac8 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -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;