summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-16 06:37:12 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-16 06:37:12 +0000
commita94679135080615136be4d83a66b3f964b8d66a4 (patch)
treeb2963b59c8b2377f5c551039abf985092167dc17 /range.c
parent62fda90d7adf5436d15f9407bed294bd5a4885be (diff)
1.1b9_03 pre2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r--range.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/range.c b/range.c
index 74ac972..fc5ae36 100644
--- a/range.c
+++ b/range.c
@@ -190,6 +190,9 @@ range_length(rng)
first = rb_iv_get(rng, "first");
last = rb_iv_get(rng, "last");
+ if (RTEST(rb_funcall(first, '>', 1, last))) {
+ return INT2FIX(0);
+ }
if (!obj_is_kind_of(first, cNumeric)) {
return enum_length(rng);
}