summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-12 13:56:21 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-12 13:56:21 +0000
commit3ee34d91b4b3a51cc21542b31899053b12b986c7 (patch)
tree9faac75fa5880eb664bd18508fb3e5639ab45645
parent8866dba90dc7e496afa04605d31685e5cd07ce65 (diff)
downloadruby-3ee34d91b4b3a51cc21542b31899053b12b986c7.tar.gz
ruby-3ee34d91b4b3a51cc21542b31899053b12b986c7.tar.xz
ruby-3ee34d91b4b3a51cc21542b31899053b12b986c7.zip
merges r23846 from trunk into ruby_1_9_1.
-- * enum.c (first_i): wrong condition for no argument #first. [ruby-core:24017] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--enum.c24
-rw-r--r--version.h2
3 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 06e9013d9..56cb9ded5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun 25 06:25:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * enum.c (first_i): wrong condition for no argument #first.
+ [ruby-core:24017]
+
Wed Jun 24 15:02:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parser_set_encode): show the erred file name instead of
diff --git a/enum.c b/enum.c
index f37bf0d37..0b6acc024 100644
--- a/enum.c
+++ b/enum.c
@@ -607,23 +607,23 @@ enum_group_by(VALUE obj)
}
static VALUE
-first_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
+first_i(VALUE i, VALUE *params, int argc, VALUE *argv)
{
ENUM_WANT_SVALUE();
- if (NIL_P(ary[0])) {
- ary[1] = i;
+ if (NIL_P(params[1])) {
+ params[1] = i;
rb_iter_break();
}
else {
- long n = ary[0];
+ long n = params[0];
- rb_ary_push(ary[1], i);
+ rb_ary_push(params[1], i);
n--;
if (n <= 0) {
rb_iter_break();
}
- ary[0] = n;
+ params[0] = n;
}
return Qnil;
}
@@ -642,10 +642,10 @@ first_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
static VALUE
enum_first(int argc, VALUE *argv, VALUE obj)
{
- VALUE n, ary[2];
+ VALUE n, params[2];
if (argc == 0) {
- ary[0] = ary[1] = Qnil;
+ params[0] = params[1] = Qnil;
}
else {
long len;
@@ -653,12 +653,12 @@ enum_first(int argc, VALUE *argv, VALUE obj)
rb_scan_args(argc, argv, "01", &n);
len = NUM2LONG(n);
if (len == 0) return rb_ary_new2(0);
- ary[0] = len;
- ary[1] = rb_ary_new2(len);
+ params[0] = len;
+ params[1] = rb_ary_new2(len);
}
- rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)ary);
+ rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)params);
- return ary[1];
+ return params[1];
}
diff --git a/version.h b/version.h
index 86362a286..3894628b4 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "1.9.1"
#define RUBY_RELEASE_DATE "2009-06-25"
-#define RUBY_PATCHLEVEL 203
+#define RUBY_PATCHLEVEL 204
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1