Page MenuHomeFreeBSD

lib/libc/amd64/string: implement strpbrk() through strcspn()
ClosedPublic

Authored by fuz on Sep 25 2023, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 22, 6:48 AM
Unknown Object (File)
Mon, Mar 9, 1:21 AM
Unknown Object (File)
Wed, Mar 4, 10:15 PM
Unknown Object (File)
Wed, Mar 4, 9:57 PM
Unknown Object (File)
Feb 8 2026, 6:09 AM
Unknown Object (File)
Jan 24 2026, 12:49 AM
Unknown Object (File)
Nov 18 2025, 8:49 PM
Unknown Object (File)
Nov 12 2025, 5:40 PM
Subscribers

Details

Summary

This lets us use our optimised strcspn() routine for strpbrk() calls.

In principle, this change could be applied to all architectures
through modification of lib/libc/string/strpbrk.c as strcspn
has a better generic implementation than strpbrk. I have avoided
this as to reduce the impact of these changes. If desired I can
update this DR to do so.

Sponsored by: The FreeBSD Foundation

Test Plan

passes test suite

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable