
/* This file is part of the GNU C Library. */

#include <string.h>

/* Return the length of the maximum initial segment
   of S which contains only characters in ACCEPT.  */
size_t
strspn(s, accept)
char *s;
char *accept;
{
  register char *p;
  register char *a;
  register size_t count = 0;

  for (p = s; *p != '\0'; ++p)
    {
      for (a = accept; *a != '\0'; ++a)
	if (*p == *a)
	  break;
      if (*a == '\0')
	return count;
      else
	++count;
    }

  return count;
}
