1 /* @(#)wcsrchr.c	1.2 09/06/05 Copyright 1985,2009 J. Schilling */
2 /*
3  *	wcsrchr() to be used if missing in libc
4  *
5  *	Copyright (c) 1985,2009 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License").  You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  * A copy of the CDDL is also available via the Internet at
15  * http://www.opensource.org/licenses/cddl1.txt
16  *
17  * When distributing Covered Code, include this CDDL HEADER in each
18  * file and include the License file CDDL.Schily.txt from this distribution.
19  */
20 
21 #include <schily/standard.h>
22 #include <schily/wchar.h>
23 #include <schily/schily.h>
24 
25 #ifndef	HAVE_WCSRCHR
26 
27 EXPORT wchar_t *
wcsrchr(s,c)28 wcsrchr(s, c)
29 	register const wchar_t	*s;
30 	register	wchar_t	c;
31 {
32 	register wchar_t	*p = NULL;
33 
34 	do {
35 		if (*s == c)
36 			p = (wchar_t *)s;
37 	} while (*s++ != '\0');
38 	return (p);
39 }
40 
41 #endif
42