History log of /freebsd-10-stable/lib/libc/string/memmem.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 313480 09-Feb-2017 ngie

MFC r283584:

Relnotes: yes

r283584 (by emaste):

memmem(3): empty little string matches the beginning of the big string

This function originated in glibc, and this matches their behaviour
(and NetBSD, OpenBSD, and musl).

An empty big string (arg "l") is handled by the existing
l_len < s_len test.


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 188080 03-Feb-2009 danger

- ANSIfy function definitions
- use nul when we are looking for a terminating character where appropriate

Approved by: imp


# 149466 25-Aug-2005 andre

Add the function memmem(3) as found in glibc and others.
It is the binary equivalent to strstr(3).

void *memmem(const void *big, size_t big_len,
const void *little, size_t little_len);

Submitted by: Pascal Gloor <pascal.gloor at spale.com>
MFC after: 3 days