summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-04 05:24:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-04 05:24:39 +0000
commit460528289ab3b22f373c00a8494f65e5c3dcfdde (patch)
tree05892a275bee3df41e2645da9f3c1fc7d6f04118 /string.c
parent79e0379a7573e998d52ea42242ea0cc96fa81738 (diff)
* 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
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
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;
}