blob: db12bbc7c6770e813722cc9de1df7b68f1905e08 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4 *
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 */
7
8#include "_string.h"
9
10#ifdef WANT_WIDE
11# define Wstrrchr wcsrchr
12#else
13# define Wstrrchr strrchr
14#endif
15
16Wchar *Wstrrchr(register const Wchar *s, Wint c)
17{
18 register const Wchar *p;
19
20 p = NULL;
21 do {
22 if (*s == (Wchar) c) {
23 p = s;
24 }
25 } while (*s++);
26
27 return (Wchar *) p; /* silence the warning */
28}
29#ifndef WANT_WIDE
30libc_hidden_weak(strrchr)
31# ifdef __UCLIBC_SUSV3_LEGACY__
32weak_alias(strrchr,rindex)
33# endif
34#endif