summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-11-01 16:27:58 +0100
committerJo-Philipp Wich <jo@mein.io>2023-11-01 16:27:58 +0100
commit448c7632dbe12c0cd0385e25503288d54a86c1e7 (patch)
treeea3d45338485af51f9c35e34228284870df0d9c7 /tests
parentcdc02034cfd4ba5f94bf26ee9e9c23609a9c47a4 (diff)
lib: enforce consistent `index()` behavior with empty needle argument
On macOS, the `memmem()` function returns `NULL` instead of the expected start of the haystack string when given a zero-length needle argument. Add special case handling for a zero-length needle argument to ensure that the expected offset `0` is returned on all systems. Ref: #176 Suggested-by: Erwan MAS <erwan@mas.nom.fr> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions