blob: 7ea4773627815e8dc3735d7218aada3fd263c9b0 [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 Wstrchr wcschr
12#else
13# define Wstrchr strchr
14#endif
15
16Wchar *Wstrchr(register const Wchar *s, Wint c)
17{
18 do {
19 if (*s == ((Wchar)c)) {
20 return (Wchar *) s; /* silence the warning */
21 }
22 } while (*s++);
23
24 return NULL;
25}
26#ifndef WANT_WIDE
27libc_hidden_def(strchr)
28# ifdef __UCLIBC_SUSV3_LEGACY__
29weak_alias(strchr,index)
30# endif
31#endif