diff options
author | alexandre184 <[email protected]> | 2023-07-15 09:36:53 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-07-15 16:36:53 +0900 |
commit | e5825de7c9f07e4f7bd2b83ce8973e19a4652916 (patch) | |
tree | 92b04125daca166707c5465402469603d33fb619 /string.c | |
parent | f15123c34ce80f3928612befe2a9aaf4c9d27fda (diff) |
[Bug #19769] Fix range of size 1 in `String#tr`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8080
Merged-By: nobu <[email protected]>
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -7714,8 +7714,10 @@ trnext(struct tr *t, rb_encoding *enc) } continue; /* not reached */ } - t->gen = 1; - t->max = c; + else if (t->now < c) { + t->gen = 1; + t->max = c; + } } } return t->now; |