diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-27 21:43:35 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-27 21:43:35 +0900 |
| commit | e6841abad69df4d20e359e0b1c2eb190696ec0c4 (patch) | |
| tree | 87e059a1440a0646cdf1b3709b326544d9a2c4b5 /mrbgems/mruby-string-ext | |
| parent | 54ec08c7f19e7c46de3dcb63e4f30cd65e4a56e7 (diff) | |
| download | mruby-e6841abad69df4d20e359e0b1c2eb190696ec0c4.tar.gz mruby-e6841abad69df4d20e359e0b1c2eb190696ec0c4.zip | |
Fixed a `String#squeeze` bug in handling `iso-8859-1` strings; ref #4127
Diffstat (limited to 'mrbgems/mruby-string-ext')
| -rw-r--r-- | mrbgems/mruby-string-ext/src/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-string-ext/src/string.c b/mrbgems/mruby-string-ext/src/string.c index ea8d77249..9e35b18a9 100644 --- a/mrbgems/mruby-string-ext/src/string.c +++ b/mrbgems/mruby-string-ext/src/string.c @@ -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--; } |
