home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / libnix-0.8-src.lha / libnix-0.8 / sources / nix / string / strtok.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  250 b   |  19 lines

  1. #include <string.h>
  2.  
  3. char *strtok(char *s1,const char *s2)
  4. { static char *t;
  5.   if(s1!=NULL)
  6.     t=s1;
  7.   else
  8.     s1=t;
  9.   s1+=strspn(s1,s2);
  10.   if(*s1=='\0')
  11.     return NULL;
  12.   t=s1;
  13.   t+=strcspn(s1,s2);
  14.   if(*t!='\0')
  15.     *t++='\0';
  16.   return s1;
  17. }
  18.   
  19.