2022-04-15 11:00:55 +02:00
|
|
|
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
size_t strspn(const char* s1, const char* s2)
|
|
|
|
{
|
|
|
|
const char *p = s1, *spanp;
|
|
|
|
char c, sc;
|
|
|
|
|
|
|
|
cont:
|
|
|
|
c = *p++;
|
|
|
|
for (spanp = s2; (sc = *spanp++) != 0;)
|
|
|
|
if (sc == c)
|
|
|
|
goto cont;
|
|
|
|
return (p - 1 - s1);
|
|
|
|
}
|