git: 9front

ref: 800334cb8d11b5fe1bd4ef40bdc53fac49a2ee21
dir: /sys/src/libc/port/utfrune.c/

View raw version
#include <u.h>
#include <libc.h>

char*
utfrune(char *s, long c)
{
	Rune r;
	char buf[UTFmax + 1] = {0};

	if(c < Runesync)		/* not part of utf sequence */
		return strchr(s, c);

	r = c;
	runetochar(buf, &r);
	return strstr(s, buf);
}