]> git.ipfire.org Git - thirdparty/systemd.git/commit
string-util: add strstrafter()
authorLennart Poettering <lennart@poettering.net>
Fri, 14 Apr 2023 10:48:14 +0000 (12:48 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 14 Apr 2023 14:56:15 +0000 (16:56 +0200)
commitd791013ff529cbbb74d4cc5f1455f172befab1e6
treea52a2742502f99537ba58cdae318336c89687aba
parentbb7b1da8fedd9ba057809a8aca06594c56f0a409
string-util: add strstrafter()

strstrafter() is like strstr() but returns a pointer to the first
character *after* the found substring, not on the substring itself.
Quite often this is what we actually want.

Inspired by #27267 I think it makes sense to add a helper for this,
to avoid the potentially fragile manual pointer increment afterwards.
src/basic/mountpoint-util.c
src/basic/string-util.h
src/libsystemd/sd-device/device-enumerator.c
src/shared/bus-get-properties.c
src/shared/edit-util.c
src/shared/xml.c
src/test/test-string-util.c