[前][次][番号順一覧][スレッド一覧]

ruby-changes:2690

From: ko1@a...
Date: 10 Dec 2007 21:02:49 +0900
Subject: [ruby-changes:2690] matz - Ruby:r14181 (trunk): * array.c (rb_ary_slice_bang): should return nil if position out

matz	2007-12-10 21:01:45 +0900 (Mon, 10 Dec 2007)

  New Revision: 14181

  Modified files:
    trunk/ChangeLog
    trunk/array.c

  Log:
    * array.c (rb_ary_slice_bang): should return nil if position out
      of range.  a patch from Akinori MUSHA <knu AT iDaemons.org>.
      [ruby-dev:32518]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/array.c?r1=14181&r2=14180
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14181&r2=14180

Index: array.c
===================================================================
--- array.c	(revision 14180)
+++ array.c	(revision 14181)
@@ -1888,6 +1888,7 @@
       delete_pos_len:
 	if (pos < 0) {
 	    pos = RARRAY_LEN(ary) + pos;
+	    if (pos < 0) return Qnil;
 	}
 	arg2 = rb_ary_subseq(ary, pos, len);
 	rb_ary_splice(ary, pos, len, Qundef);	/* Qnil/rb_ary_new2(0) */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14180)
+++ ChangeLog	(revision 14181)
@@ -1,3 +1,9 @@
+Mon Dec 10 21:00:30 2007  Yukihiro Matsumoto  <matz@r...>
+
+	* array.c (rb_ary_slice_bang): should return nil if position out
+	  of range.  a patch from Akinori MUSHA <knu AT iDaemons.org>.
+	  [ruby-dev:32518]
+
 Mon Dec 10 19:02:52 2007  Yukihiro Matsumoto  <matz@r...>
 
 	* re.c (rb_reg_match): should calculate offset by converted

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]