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/strrchr.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/strrchr.c')
-rw-r--r-- | libc/string/strrchr.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/libc/string/strrchr.c b/libc/string/strrchr.c index 374abb694..cb30afea7 100644 --- a/libc/string/strrchr.c +++ b/libc/string/strrchr.c @@ -1,16 +1,35 @@ /* + * 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_strrchr -#define Wstrrchr __strrchr +#include "_string.h" -#include "wstring.c" +#ifdef WANT_WIDE +# define __Wstrrchr __wcsrchr +# define Wstrrchr wcsrchr +#else +# define __Wstrrchr __strrchr +# define Wstrrchr strrchr +#endif -strong_alias(__strrchr, strrchr) +Wchar attribute_hidden *__Wstrrchr(register const Wchar *s, Wint c) +{ + register const Wchar *p; -weak_alias(strrchr, rindex) + p = NULL; + do { + if (*s == (Wchar) c) { + p = s; + } + } while (*s++); -#undef L_strrchr + return (Wchar *) p; /* silence the warning */ +} + +strong_alias(__Wstrrchr,Wstrrchr) +#ifndef WANT_WIDE +strong_alias(__strrchr,rindex) +#endif |