From: Yu Watanabe Date: Fri, 24 Nov 2023 14:42:04 +0000 (+0900) Subject: analyze: return earlier when there is no path to be prepended X-Git-Tag: v255-rc4~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33d11a2b69b45491bca07e4167073b78b500d09f;p=thirdparty%2Fsystemd.git analyze: return earlier when there is no path to be prepended Follow-up for 2f6181ad4d6c126e3ebf6880ba30b3b0059c6fc8. Addresses the post-merge comment: https://github.com/systemd/systemd/pull/30172#discussion_r1404209035 --- diff --git a/src/analyze/analyze-verify-util.c b/src/analyze/analyze-verify-util.c index f3ce0ad1f17..26d11304771 100644 --- a/src/analyze/analyze-verify-util.c +++ b/src/analyze/analyze-verify-util.c @@ -98,13 +98,13 @@ int verify_set_unit_path(char **filenames) { return r; } + if (strv_isempty(ans)) + return 0; + joined = strv_join(strv_uniq(ans), ":"); if (!joined) return -ENOMEM; - if (isempty(joined)) - return 0; - /* First, prepend our directories. Second, if some path was specified, use that, and * otherwise use the defaults. Any duplicates will be filtered out in path-lookup.c. * Treat explicit empty path to mean that nothing should be appended. */