From 460528289ab3b22f373c00a8494f65e5c3dcfdde Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 4 Jan 2012 05:24:39 +0000 Subject: * string.c (str_nth_len): count ascii-only run at the end. this bug appears only when single-byte-optimization is disabled due to unknown coderange. [ruby-core:41896] [Bug #5836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 1 + 1 file changed, 1 insertion(+) (limited to 'string.c') diff --git a/string.c b/string.c index 61703a7057..606fef7a42 100644 --- a/string.c +++ b/string.c @@ -1483,6 +1483,7 @@ str_nth_len(const char *p, const char *e, long *nthp, rb_encoding *enc) if (ISASCII(*p)) { p2 = search_nonascii(p, e2); if (!p2) { + nth -= e2 - p; *nthp = nth; return (char *)e2; } -- cgit v1.2.3