tree-wide: port various places to find_line_startswith()

This commit is contained in:
Lennart Poettering
2023-03-24 18:30:20 +01:00
parent 7b82d95f8d
commit 50ed5cbf5f
4 changed files with 12 additions and 32 deletions
+3 -8
View File
@@ -93,14 +93,9 @@ static int url_from_catalog(sd_journal *j, char **ret) {
if (r < 0)
return log_error_errno(r, "Failed to find catalog entry: %m");
weblink = startswith(t, "Documentation:");
if (!weblink) {
weblink = strstr(t + 1, "\nDocumentation:");
if (!weblink)
goto notfound;
weblink += 15;
}
weblink = find_line_startswith(t, "Documentation:");
if (!weblink)
goto notfound;
/* Skip whitespace to value */
weblink += strspn(weblink, " \t");