From 50ed5cbf5f305d331a2f72a389cb39c9e670286c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 24 Mar 2023 18:25:13 +0100 Subject: tree-wide: port various places to find_line_startswith() --- src/import/importd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/import') diff --git a/src/import/importd.c b/src/import/importd.c index ed757019cf..4675aa5a61 100644 --- a/src/import/importd.c +++ b/src/import/importd.c @@ -590,14 +590,9 @@ static int manager_on_notify(sd_event_source *s, int fd, uint32_t revents, void buf[n] = 0; - p = startswith(buf, "X_IMPORT_PROGRESS="); - if (!p) { - p = strstr(buf, "\nX_IMPORT_PROGRESS="); - if (!p) - return 0; - - p += 19; - } + p = find_line_startswith(buf, "X_IMPORT_PROGRESS="); + if (!p) + return 0; e = strchrnul(p, '\n'); *e = 0; -- cgit v1.2.1