Subversion Repositories Kolibri OS

Rev

Rev 8793 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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