lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 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 | |
| 8 | #include "_string.h" |
| 9 | |
| 10 | #ifdef WANT_WIDE |
| 11 | # define Wstrspn wcsspn |
| 12 | #else |
| 13 | # define Wstrspn strspn |
| 14 | #endif |
| 15 | |
| 16 | size_t Wstrspn(const Wchar *s1, const Wchar *s2) |
| 17 | { |
| 18 | register const Wchar *s = s1; |
| 19 | register const Wchar *p = s2; |
| 20 | |
| 21 | while (*p) { |
| 22 | if (*p++ == *s) { |
| 23 | ++s; |
| 24 | p = s2; |
| 25 | } |
| 26 | } |
| 27 | return s - s1; |
| 28 | } |
| 29 | libc_hidden_def(Wstrspn) |