blob: 2b74678dc136d36881c3feadda9c99cd27664730 [file] [edit]
/* See LICENSE file for copyright and license details. */
#include <string.h>
#include "utf.h"
char *
utfrrune(const char *s, Rune r)
{
const char *p = NULL;
Rune r0;
int n;
if(r < Runeself)
return strrchr(s, r);
for(; *s != '\0'; s += n) {
n = chartorune(&r0, s);
if(r == r0)
p = s;
}
return (char *)p;
}