diff options
Diffstat (limited to 'sys/libunicode/findlast.c')
-rw-r--r-- | sys/libunicode/findlast.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/libunicode/findlast.c b/sys/libunicode/findlast.c index 3a4ed38..ab25ab2 100644 --- a/sys/libunicode/findlast.c +++ b/sys/libunicode/findlast.c @@ -7,19 +7,21 @@ utf8·findlast(byte* s, rune c) rune r; byte *l; - if(c < RuneSync) + if(c < Tx) return strrchr(s, c); l = nil; for(;;){ c1 = *(ubyte*)s; - if(c1 < RuneSelf) { + if(c1 < Tx){ if(c1 == 0) return l; if(c1 == c) l = s; s++; continue; } + c1 = utf8·decode(s, &r); + if(r == c) l = s; |