diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-11-01 16:27:58 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-11-01 16:27:58 +0100 |
commit | 448c7632dbe12c0cd0385e25503288d54a86c1e7 (patch) | |
tree | ea3d45338485af51f9c35e34228284870df0d9c7 /CMakeLists.txt | |
parent | cdc02034cfd4ba5f94bf26ee9e9c23609a9c47a4 (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 'CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions