mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_ungetc): calculates new position
before reallocation. [Bug#1099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9565e98b6e
commit
ee159271dd
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Feb 12 17:17:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/stringio/stringio.c (strio_ungetc): calculates new position
|
||||
before reallocation. [Bug#1099]
|
||||
|
||||
Thu Feb 12 16:50:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in: a patch to build on GNU/kOpenSolaris from Rober
|
||||
|
|
|
@ -728,8 +728,9 @@ strio_ungetc(VALUE self, VALUE c)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue