aboutsummaryrefslogtreecommitdiffstats
path: root/regenc.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-08 12:28:42 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-08 12:28:42 +0000
commitf0fc6ec872f043836f01455b16feee6bb9ed9eb9 (patch)
treee70acb99167bd9f78c20e5a5b61a57b5e6fb17fb /regenc.c
parent404d6e9f38a8b7069287711bfb3431c52d363f56 (diff)
downloadruby-f0fc6ec872f043836f01455b16feee6bb9ed9eb9.tar.gz
* string.c: New static function rb_str_ascii_casemap; special-casing
:ascii option in rb_str_upcase_bang and rb_str_downcase_bang. * regenc.c: Fix a bug (wrong use of unnecessary slack at end of string). * regenc.h -> include/ruby/oniguruma.h: Move declaration of onigenc_ascii_only_case_map so that it is visible in string.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regenc.c')
-rw-r--r--regenc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/regenc.c b/regenc.c
index abc0c029c8..d345b0f8d5 100644
--- a/regenc.c
+++ b/regenc.c
@@ -968,9 +968,7 @@ onigenc_ascii_only_case_map (OnigCaseFoldType* flagP, const OnigUChar** pp, cons
OnigCaseFoldType flags = *flagP;
int codepoint_length;
- to_end -= 4; /* longest possible length of a single character */
-
- while (*pp<end && to<=to_end) {
+ while (*pp<end && to<to_end) {
codepoint_length = ONIGENC_PRECISE_MBC_ENC_LEN(enc, *pp, end);
if (codepoint_length < 0)
return codepoint_length; /* encoding invalid */