blob: 0466af99b0debccad627ef2c7eeb306826b8509c [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
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 Wstrcspn wcscspn
12#else
13# define Wstrcspn strcspn
14#endif
15
16size_t Wstrcspn(const Wchar *s1, const Wchar *s2)
17{
18 register const Wchar *s;
19 register const Wchar *p;
20
21 for ( s=s1 ; *s ; s++ ) {
22 for ( p=s2 ; *p ; p++ ) {
23 if (*p == *s) goto done;
24 }
25 }
26 done:
27 return s - s1;
28}
29
30#ifndef WANT_WIDE
31libc_hidden_def(strcspn)
32#endif