From 167d5e33fcb821e51e2f9dcf460591737c3c7972 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Tue, 3 Jan 2006 14:50:18 +0000 Subject: Complete split of all the string functions. Hope haven't broken too much. wcscoll/strcoll needs some love ... --- libc/string/strchr.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'libc/string/strchr.c') diff --git a/libc/string/strchr.c b/libc/string/strchr.c index a58e1f56d..478e4967c 100644 --- a/libc/string/strchr.c +++ b/libc/string/strchr.c @@ -1,16 +1,33 @@ /* + * Copyright (C) 2002 Manuel Novoa III * Copyright (C) 2000-2005 Erik Andersen * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#define L_strchr -#define Wstrchr __strchr +#include "_string.h" -#include "wstring.c" +#ifdef WANT_WIDE +# define __Wstrchr __wcschr +# define Wstrchr wcschr +#else +# define __Wstrchr __strchr +# define Wstrchr strchr +#endif -strong_alias(__strchr, strchr) +Wchar attribute_hidden *__Wstrchr(register const Wchar *s, Wint c) +{ + do { + if (*s == ((Wchar)c)) { + return (Wchar *) s; /* silence the warning */ + } + } while (*s++); -weak_alias(strchr, index) + return NULL; +} -#undef L_strchr +strong_alias(__strchr,strchr) + +#ifndef WANT_WIDE +strong_alias(__strchr,index) +#endif -- cgit v1.2.3