summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-24 09:48:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-24 09:48:21 +0000
commit280d014d6d72deac20d4ac3d180718125d5bd56e (patch)
treeb5a3121173a5179382f052482ee4b92e7b9349f1 /string.c
parentca14017bb65ee6316bfd400ac3efd6abe3ab70ed (diff)
* range.c (rb_range_beg_len): returns Qnil only when "beg" points
outside of a range. No boundary check for "end". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 63816fdaff..e68dfcc20a 100644
--- a/string.c
+++ b/string.c
@@ -1552,7 +1552,8 @@ rb_str_aref(str, indx)
* a[1..3] #=> "ell"
* a[-3,2] #=> "er"
* a[-4..-2] #=> "her"
- * a[-2..-4] #=> nil
+ * a[12..-1] #=> nil
+ * a[-2..-4] #=> ""
* a[/[aeiou](.)\1/] #=> "ell"
* a[/[aeiou](.)\1/, 0] #=> "ell"
* a[/[aeiou](.)\1/, 1] #=> "l"