diff options
| author | dearblue <[email protected]> | 2019-08-10 22:21:49 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2019-08-17 12:05:03 +0900 |
| commit | bc272730874b5f0e22f0b7126ec46bc761d335b1 (patch) | |
| tree | adb39390ecfaadb43526ab2b8912c02ded94847c /tasks/libmruby.rake | |
| parent | 414ab682f37118288864f5298ea5eb2cd3791dd2 (diff) | |
| download | mruby-bc272730874b5f0e22f0b7126ec46bc761d335b1.tar.gz mruby-bc272730874b5f0e22f0b7126ec46bc761d335b1.zip | |
Fix `String#rindex` with invalid UTF-8 string
Previously `String#rindex` returned the wrong index when given an
invalid UTF-8 string.
```terminal
% ruby26 -e 'str = "\xf0☀\xf1☁\xf2☂\xf3☃\xf0☀\xf1☁\xf2☂\xf3☃"; p str.rindex("☁")'
11
% ./mruby-head -e 'str = "\xf0☀\xf1☁\xf2☂\xf3☃\xf0☀\xf1☁\xf2☂\xf3☃"; p str.rindex("☁")'
nil
% ./mruby-patched -e 'str = "\xf0☀\xf1☁\xf2☂\xf3☃\xf0☀\xf1☁\xf2☂\xf3☃"; p str.rindex("☁")'
11
```
Diffstat (limited to 'tasks/libmruby.rake')
0 files changed, 0 insertions, 0 deletions
