Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 2014 02:23:24 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273020 - head/contrib/netbsd-tests/lib/libc/string
Message-ID:  <201410130223.s9D2NOCY032954@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Oct 13 02:23:24 2014
New Revision: 273020
URL: https://svnweb.freebsd.org/changeset/base/273020

Log:
  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

Modified:
  head/contrib/netbsd-tests/lib/libc/string/t_memmem.c

Modified: head/contrib/netbsd-tests/lib/libc/string/t_memmem.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/string/t_memmem.c	Mon Oct 13 01:14:01 2014	(r273019)
+++ head/contrib/netbsd-tests/lib/libc/string/t_memmem.c	Mon Oct 13 02:23:24 2014	(r273020)
@@ -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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410130223.s9D2NOCY032954>