summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 22:08:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 22:08:45 +0000
commitbfcd4e54538b1dd415ed1f3bebe482df11b383c2 (patch)
treecd7525102def020f688ca4bbd27bf74814fc95d9 /ext/stringio/stringio.c
parent15dad95dfcb092fea28ebc1e1a6aba6df119b1e0 (diff)
* ext/stringio/stringio.c (strio_getline): round upto next char
boundary. [ruby-dev:42674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30063 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 75f8cd7..7edf711 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -954,7 +954,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
e = s + RSTRING_LEN(ptr->string);
s += ptr->pos;
if (limit > 0 && s + limit < e) {
- e = s + limit;
+ e = rb_enc_right_char_head(s, s + limit, e, rb_enc_get(ptr->string));
}
if (NIL_P(str)) {
str = strio_substr(ptr, ptr->pos, e - s);