summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 08:32:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 08:32:55 +0000
commit75fcee4a23d5a549f407a0404732e2ccc6b949e1 (patch)
treea2301886e4da1eab0769f79e2705dc0d9afe93b1 /ext/stringio/stringio.c
parent6a638cc1960548c1e3bc5ceba6a56c1b274ae9b1 (diff)
* ext/stringio/stringio.c (strio_ungetc): ungetc position should
not be changed from 1.8. [ruby-core:19632] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio/stringio.c')
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 191c1024c4..4c997dcd04 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;