<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/string/strstr.c, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-11-27T04:20:09Z</updated>
<entry>
<title>libc: Purge unneeded cdefs.h</title>
<updated>2023-11-27T04:20:09Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-01T22:43:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4025b5b527c870cf095ac9531764f4e4d3feaec2'/>
<id>urn:sha1:4025b5b527c870cf095ac9531764f4e4d3feaec2</id>
<content type='text'>
These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D42385

(cherry picked from commit 559a218c9b257775fb249b67945fe4a05b7a6b9f)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:42Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1d386b48a555f61cb7325543adbbb5c3f3407a66'/>
<id>urn:sha1:1d386b48a555f61cb7325543adbbb5c3f3407a66</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
<entry>
<title>libc: correct SPDX tag on strstr.c</title>
<updated>2022-01-16T16:56:28Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2022-01-16T16:56:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2e9bc9d14440aa17e6945a9b6613ebb1711fe960'/>
<id>urn:sha1:2e9bc9d14440aa17e6945a9b6613ebb1711fe960</id>
<content type='text'>
It was obtained from musl, and is MIT licensed.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>libc: fix misleading comment in strstr</title>
<updated>2022-01-16T16:52:29Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2022-01-16T16:50:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c6750f07b43d18d39729570533f4ecb56da286bf'/>
<id>urn:sha1:c6750f07b43d18d39729570533f4ecb56da286bf</id>
<content type='text'>
Obtained from:	musl c53e9b239418
</content>
</entry>
<entry>
<title>libc: fix undefined behavior from signed overflow in strstr and memmem</title>
<updated>2020-11-19T00:03:15Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2020-11-19T00:03:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=33482dae89c26158a22ccb3b7f2ca6e6652f29b4'/>
<id>urn:sha1:33482dae89c26158a22ccb3b7f2ca6e6652f29b4</id>
<content type='text'>
unsigned char promotes to int, which can overflow when shifted left by
24 bits or more. this has been reported multiple times but then
forgotten. it's expected to be benign UB, but can trap when built with
explicit overflow catching (ubsan or similar). fix it now.

note that promotion to uint32_t is safe and portable even outside of
the assumptions usually made in musl, since either uint32_t has rank
at least unsigned int, so that no further default promotions happen,
or int is wide enough that the shift can't overflow. this is a
desirable property to have in case someone wants to reuse the code
elsewhere.

musl commit: 593caa456309714402ca4cb77c3770f4c24da9da

Obtained from:	musl
</content>
</entry>
<entry>
<title>clang-format libc string functions imported from musl</title>
<updated>2020-11-18T22:01:34Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2020-11-18T22:01:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4874ddfd373c582d9cd7fe915d2259295d75d1e5'/>
<id>urn:sha1:4874ddfd373c582d9cd7fe915d2259295d75d1e5</id>
<content type='text'>
We have adopted these and don't consider them 'contrib' code, so bring
them closer to style(9).  This is a followon to r315467 and r351700.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>libc: update strstr implementation to match musl</title>
<updated>2019-04-09T15:52:18Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2019-04-09T15:52:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=22ccf855bfb771f59f5aaaae1d26d33679fec931'/>
<id>urn:sha1:22ccf855bfb771f59f5aaaae1d26d33679fec931</id>
<content type='text'>
musl commits:
122d67f846cb0be2c9e1c3880db9eb9545bbe38c
0239cd0681e889a269fb7691f60e81ef8d081e6b
8f5a820d147da36bcdbddd201b35d293699dacd8

Submitted by:	David CARLIER &lt;devnexen_gmail.com&gt;
Obtained from:	musl
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D19834
</content>
</entry>
<entry>
<title>General further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-20T19:49:47Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-20T19:49:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8a16b7a18f5d0b031f09832fd7752fba717e2a97'/>
<id>urn:sha1:8a16b7a18f5d0b031f09832fd7752fba717e2a97</id>
<content type='text'>
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
</content>
</entry>
<entry>
<title>libc: add reference to two-way algorithm and bad shift table in memmem/strstr</title>
<updated>2017-03-18T00:53:24Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2017-03-18T00:53:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=01dc206b226cccc287d6e1bfb2c1ff619728fc72'/>
<id>urn:sha1:01dc206b226cccc287d6e1bfb2c1ff619728fc72</id>
<content type='text'>
Requested by:	ed
</content>
</entry>
<entry>
<title>libc: Use musl's O(n) memmem and strstr</title>
<updated>2017-03-18T00:51:39Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2017-03-18T00:51:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=88521634e964e3da78a0ce54109cddb59bf3f099'/>
<id>urn:sha1:88521634e964e3da78a0ce54109cddb59bf3f099</id>
<content type='text'>
It is O(n) in the length of the haystack (big) string, and has special
cases for short needle (little) strings, of one to four bytes, to avoid
excessive overhead.

There are a small set of nearly trivial cases where the startup overhead
of the musl implementation makes it slightly slower -- for example, a 31
byte needle that matches the beginning of the haystack.  It's faster for
non-trivial cases, and significantly so for inputs that trigger worst-
case behaviour of the previous implementation.  As an example, in my
tests a 16K needle that matches the end of a 64K haystack is nearly
2000x faster with this implementation.

Reviewed by:	bapt (earlier), ed (earlier)
Obtained from:	musl (snapshot at commit c718f9fc)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2601
</content>
</entry>
</feed>
