Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Jo-Philipp Wich <[email protected]>
- Loading branch information