Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 2019 11:30:41 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346268 - stable/12/lib/libc/string
Message-ID:  <201904161130.x3GBUf8l042485@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Apr 16 11:30:41 2019
New Revision: 346268
URL: https://svnweb.freebsd.org/changeset/base/346268

Log:
  MFC r346054: libc: update strstr implementation to match musl
  
  musl commits:
  122d67f846cb0be2c9e1c3880db9eb9545bbe38c
  0239cd0681e889a269fb7691f60e81ef8d081e6b
  8f5a820d147da36bcdbddd201b35d293699dacd8
  
  Submitted by:	David CARLIER <devnexen_gmail.com>
  Obtained from:	musl
  MFC after:	1 week

Modified:
  stable/12/lib/libc/string/strstr.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/string/strstr.c
==============================================================================
--- stable/12/lib/libc/string/strstr.c	Tue Apr 16 11:20:10 2019	(r346267)
+++ stable/12/lib/libc/string/strstr.c	Tue Apr 16 11:30:41 2019	(r346268)
@@ -143,9 +143,8 @@ static char *twoway_strstr(const unsigned char *h, con
 		/* Check last byte first; advance by shift on mismatch */
 		if (BITOP(byteset, h[l-1], &)) {
 			k = l-shift[h[l-1]];
-			//printf("adv by %zu (on %c) at [%s] (%zu;l=%zu)\n", k, h[l-1], h, shift[h[l-1]], l);
 			if (k) {
-				if (mem0 && mem && k < p) k = l-p;
+				if (k < mem) k = mem;
 				h += k;
 				mem = 0;
 				continue;



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