aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/stringio/stringio.c4
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 <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.
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;