diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-03 14:50:18 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-03 14:50:18 +0000 |
commit | 167d5e33fcb821e51e2f9dcf460591737c3c7972 (patch) | |
tree | 79acefdd8c9781098adbf77278415eda6365fd3d /libc/string/strchr.c | |
parent | fe68563b9a070fedf117c8738652587945427bb3 (diff) |
Complete split of all the string functions. Hope haven't broken too much. wcscoll/strcoll needs some love ...
Diffstat (limited to 'libc/string/strchr.c')
-rw-r--r-- | libc/string/strchr.c | 29 |
1 files changed, 23 insertions, 6 deletions
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 <andersen@uclibc.org> * * 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 |