From 9a2ec8f7a6d55edc029eb83d23bb5cc786b24edb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 7 Jan 2020 16:42:25 +0100 Subject: [PATCH] install: use path_strv_contains() where appropriate --- src/shared/install.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/shared/install.c b/src/shared/install.c index 0e673b33588..b98c8e01cfc 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -105,7 +105,6 @@ DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(unit_file_type, UnitFileType); static int in_search_path(const LookupPaths *p, const char *path) { _cleanup_free_ char *parent = NULL; - char **i; assert(path); @@ -113,11 +112,7 @@ static int in_search_path(const LookupPaths *p, const char *path) { if (!parent) return -ENOMEM; - STRV_FOREACH(i, p->search_path) - if (path_equal(parent, *i)) - return true; - - return false; + return path_strv_contains(p->search_path, parent); } static const char* skip_root(const LookupPaths *p, const char *path) {