home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / string / strspn.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-29  |  314 b   |  17 lines

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <string.h>
  3.  
  4. size_t
  5. strspn(const char *s1, const char *s2)
  6. {
  7.   const char *p = s1, *spanp;
  8.   char c, sc;
  9.  
  10.  cont:
  11.   c = *p++;
  12.   for (spanp = s2; (sc = *spanp++) != 0;)
  13.     if (sc == c)
  14.       goto cont;
  15.   return (p - 1 - s1);
  16. }
  17.