Fixed a String#squeeze bug in handling iso-8859-1 strings; ref #4127

This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-09-27 21:43:35 +09:00
parent 54ec08c7f1
commit e6841abad6
+1 -1
View File
@@ -573,7 +573,7 @@ str_squeeze(mrb_state *mrb, mrb_value str, mrb_value v_pat)
else {
for (i=j=0; i<len; i++,j++) {
if (i>j) s[j] = s[i];
if (s[i] == lastch) {
if (s[i] >= 0 && s[i] == lastch) {
flag_changed = TRUE;
j--;
}