summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-30 16:46:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-30 16:46:13 +0000
commit4c04407b192c7e11bac8e195703271c87c4c004e (patch)
treef0d96f9455ea14850f22277f6075941b7e35e970
parentc018c992da9409a27181311cb7633eb3662bb9fc (diff)
* enum.c (enum_min, enum_max): must not return Qundef.
fixed: [ruby-core:05299] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--enum.c2
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 26f90de..6d58f8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 1 01:45:21 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (enum_min, enum_max): must not return Qundef.
+ fixed: [ruby-core:05299]
+
Fri Jul 1 00:18:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator::respond_to): respond_to? must check
@@ -5,8 +10,8 @@ Fri Jul 1 00:18:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
Thu Jun 30 19:00:21 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
* lib/irb/ruby-lex.rb (RubyLex::identify_number): alternative implements
- for [ruby-dev:26410]. And support a numeric form of 0d99999.
-
+ for [ruby-dev:26410]. And support a numeric form of 0d99999.
+
Thu Jun 30 17:28:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/ruby-lex.rb (RubyLex::identify_number): should not treat
diff --git a/enum.c b/enum.c
index 102257f..a50de77 100644
--- a/enum.c
+++ b/enum.c
@@ -660,6 +660,7 @@ enum_min(obj)
VALUE result = Qundef;
rb_iterate(rb_each, obj, rb_block_given_p() ? min_ii : min_i, (VALUE)&result);
+ if (result == Qundef) return Qnil;
return result;
}
@@ -736,6 +737,7 @@ enum_max(obj)
VALUE result = Qundef;
rb_iterate(rb_each, obj, rb_block_given_p() ? max_ii : max_i, (VALUE)&result);
+ if (result == Qundef) return Qnil;
return result;
}