Blame src/regression/wcsstr-false-negative.c
|
Szabolcs Nagy |
f0101b |
// commit 476cd1d96560aaf7f210319597556e7fbcd60469 2014-04-18
|
|
Szabolcs Nagy |
f0101b |
// wcsstr (strstr and memmem) failed to match repetitive needles in some cases
|
|
Szabolcs Nagy |
f0101b |
#include <wchar.h>
|
|
Szabolcs Nagy |
f0101b |
#include "test.h"
|
|
Szabolcs Nagy |
f0101b |
|
|
Szabolcs Nagy |
f0101b |
int main(int argc, char* argv[])
|
|
Szabolcs Nagy |
f0101b |
{
|
|
Szabolcs Nagy |
f0101b |
wchar_t const *haystack = L"playing play play play always";
|
|
Szabolcs Nagy |
f0101b |
wchar_t const *needle = L"play play play";
|
|
Szabolcs Nagy |
f0101b |
wchar_t *p = wcsstr(haystack, needle);
|
|
Szabolcs Nagy |
f0101b |
if (p != haystack+8)
|
|
Szabolcs Nagy |
f0101b |
t_error("wcsstr(L\"%S\",L\"%S\") failed: got %p, want %p\n", haystack, needle, p, haystack+8);
|
|
Szabolcs Nagy |
f0101b |
return t_status;
|
|
Szabolcs Nagy |
f0101b |
}
|