From b3c1c767ea64ce435c115cece5074274b7aefadc Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Wed, 26 Aug 2020 22:46:58 +0200 Subject: [stringio] fix stringio codepoint enumerator off by one error --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/stringio/stringio.c') diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 01309decc9..357e4f12c1 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -1095,8 +1095,8 @@ strio_each_codepoint(VALUE self) c = rb_enc_codepoint_len(RSTRING_PTR(ptr->string)+ptr->pos, RSTRING_END(ptr->string), &n, enc); - rb_yield(UINT2NUM(c)); ptr->pos += n; + rb_yield(UINT2NUM(c)); } return self; } -- cgit v1.2.3