memmem with NUL length "needle" (aka small) strings on FreeBSD/OSX returns

NULL instead of the "haystack" value (aka big)

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2014-10-13 02:23:24 +00:00
parent effc369887
commit 21a9353bfd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273020

View File

@ -75,8 +75,13 @@ ATF_TC_HEAD(memmem_basic, tc)
ATF_TC_BODY(memmem_basic, tc)
{
#if defined(__darwin__) || defined(__FreeBSD__)
expect(memmem(b2, lb2, p0, lp0) == NULL);
expect(memmem(b0, lb0, p0, lp0) == NULL);
#else
expect(memmem(b2, lb2, p0, lp0) == b2);
expect(memmem(b0, lb0, p0, lp0) == b0);
#endif
expect(memmem(b0, lb0, p1, lp1) == NULL);
expect(memmem(b1, lb1, p1, lp1) == NULL);