From 05709d7d8efd46cf78bd339a4ed355697b21bc8f Mon Sep 17 00:00:00 2001 From: yugui Date: Tue, 11 Nov 2008 11:01:21 +0000 Subject: merges r20150 from trunk into ruby_1_9_1. * ext/stringio/stringio.c (strio_ungetc): ungetc position should not be changed from 1.8. [ruby-core:19632] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/stringio/stringio.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2fa0c5f45..6ea6af0dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Nov 8 17:31:41 2008 Yukihiro Matsumoto + + * ext/stringio/stringio.c (strio_ungetc): ungetc position should + not be changed from 1.8. [ruby-core:19632] + Sat Nov 8 17:15:08 2008 Yukihiro Matsumoto * lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 191c1024c..4c997dcd0 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -721,7 +721,7 @@ strio_ungetc(VALUE self, VALUE c) } } /* get logical position */ - lpos = 0; p = RSTRING_PTR(ptr->string); pend = p + ptr->pos - 1; + lpos = 0; p = RSTRING_PTR(ptr->string); pend = p + ptr->pos; for (;;) { clen = rb_enc_mbclen(p, pend, enc); if (p+clen >= pend) break; -- cgit