/* Returns: a pointer to the found character or NULL.  */
gchar* g_utf8_find_prev_char(const char *str, const char *p)
/* Returns: a pointer to the found character or NULL.  */
gchar* g_utf8_find_prev_char(const char *str, const char *p)
{
  for (--p; p >= str; --p)
    {
      if ((*p & 0xc0) != 0x80)
	return (gchar *)p;
    }
  return NULL;
}