scc

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

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

 1#include <stddef.h>
 2#include <string.h>
 3
 4#undef strstr
 5
 6char *
 7strstr(const char *s1, const char *s2)
 8{
 9	const char *p;
10	int c = *s2;
11	size_t len;
12
13	if ((len = strlen(s2)) == 0)
14		return (char *) s1;
15
16	for (p = s1; p = strchr(p, c); ++p) {
17		if (!strncmp(p, s2, len))
18			return (char *) p;
19	}
20
21	return NULL;
22}