scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

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