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

ruby-changes:10955

From: yugui <ko1@a...>
Date: Sun, 22 Feb 2009 21:49:16 +0900 (JST)
Subject: [ruby-changes:10955] Ruby:r22531 (ruby_1_9_1): merges r22253 from trunk into ruby_1_9_1.

yugui	2009-02-22 21:49:06 +0900 (Sun, 22 Feb 2009)

  New Revision: 22531

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22531

  Log:
    merges r22253 from trunk into ruby_1_9_1.
    * ext/stringio/stringio.c (strio_ungetc): calculates new position
      before reallocation.  [Bug#1099]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/ext/stringio/stringio.c

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 22530)
+++ ruby_1_9_1/ChangeLog	(revision 22531)
@@ -1,3 +1,8 @@
+Thu Feb 12 17:17:51 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/stringio/stringio.c (strio_ungetc): calculates new position
+	  before reallocation.  [Bug#1099]
+
 Mon Feb  9 20:11:55 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/win32ole/win32ole.c (load_conv_function51932): fixed for the
Index: ruby_1_9_1/ext/stringio/stringio.c
===================================================================
--- ruby_1_9_1/ext/stringio/stringio.c	(revision 22530)
+++ ruby_1_9_1/ext/stringio/stringio.c	(revision 22531)
@@ -728,8 +728,9 @@
 	p += clen;
 	lpos++;
     }
+    clen = p - RSTRING_PTR(ptr->string);
     rb_str_update(ptr->string, lpos, ptr->pos ? 1 : 0, c);
-    ptr->pos = p - RSTRING_PTR(ptr->string);
+    ptr->pos = clen;
 
     return Qnil;
 }

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

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