scc

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

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

 1#include <wchar.h>
 2
 3#undef wcsstr
 4
 5wchar_t *
 6wcsstr(const wchar_t *s1, const wchar_t *s2)
 7{
 8	wchar_t *p = (wchar_t *) s1;
 9	wchar_t c = *s2;
10	size_t len;
11
12	if ((len = wcslen(s2)) == 0)
13		return p;
14
15	for ( ; p = wcschr(p, c); ++p) {
16		if (!wcsncmp(p, s2, len))
17			return p;
18	}
19
20	return NULL;
21}
22