strpbrk.c 657 B

12345678910111213141516171819202122232425262728293031
  1. /*
  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. #include "_string.h"
  8. #ifdef WANT_WIDE
  9. # define __Wstrpbrk __wcspbrk
  10. # define Wstrpbrk wcspbrk
  11. #else
  12. # define __Wstrpbrk __strpbrk
  13. # define Wstrpbrk strpbrk
  14. #endif
  15. Wchar attribute_hidden *__Wstrpbrk(const Wchar *s1, const Wchar *s2)
  16. {
  17. register const Wchar *s;
  18. register const Wchar *p;
  19. for ( s=s1 ; *s ; s++ ) {
  20. for ( p=s2 ; *p ; p++ ) {
  21. if (*p == *s) return (Wchar *) s; /* silence the warning */
  22. }
  23. }
  24. return NULL;
  25. }
  26. strong_alias(__Wstrpbrk,Wstrpbrk)