string-util: add new helper for finding line starting with specific string in a text buffer

We have implemented this manually a couple of times, and always wrong.
Hence let's implement this correctly for once and use everywhere.
This commit is contained in:
Lennart Poettering
2023-03-24 18:02:32 +01:00
parent 32e07cff96
commit 7b82d95f8d
3 changed files with 54 additions and 0 deletions

View File

@@ -253,3 +253,5 @@ size_t strspn_from_end(const char *str, const char *accept);
char *strdupspn(const char *a, const char *accept);
char *strdupcspn(const char *a, const char *reject);
char *find_line_startswith(const char *haystack, const char *needle);