]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/strv: minor coding style follow-ups
authorMike Yuan <me@yhndnzj.com>
Tue, 18 Feb 2025 13:32:30 +0000 (14:32 +0100)
committerMike Yuan <me@yhndnzj.com>
Fri, 21 Feb 2025 15:12:59 +0000 (16:12 +0100)
Follow-up for 428146dc89506725f777ae82d288439340926a83

Addresses https://github.com/systemd/systemd/pull/36271#discussion_r1958334800

src/basic/strv.c
src/basic/strv.h

index d81c9f127c95a79bf20c70742f3b87a2c94bd7ae..184804cea06282de78a9dce1bf792fd187b8841a 100644 (file)
@@ -1239,14 +1239,14 @@ int strv_rebreak_lines(char **l, size_t width, char ***ret) {
         return 0;
 }
 
-char** strv_filter_prefix(char *const*l, const char *prefix) {
-        _cleanup_strv_free_ char **f = NULL;
+char** strv_filter_prefix(char * const *l, const char *prefix) {
 
         /* Allocates a copy of 'l', but only copies over entries starting with 'prefix' */
 
         if (isempty(prefix))
                 return strv_copy(l);
 
+        _cleanup_strv_free_ char **f = NULL;
         size_t sz = 0;
 
         STRV_FOREACH(i, l) {
index 64787237157171de9645cceba55300c5dc1c67e1..71aae2b20a84e95d784326522faafd12426ec0f3 100644 (file)
@@ -269,4 +269,4 @@ int _string_strv_ordered_hashmap_put(OrderedHashmap **h, const char *key, const
 
 int strv_rebreak_lines(char **l, size_t width, char ***ret);
 
-char** strv_filter_prefix(char *const*l, const char *prefix);
+char** strv_filter_prefix(char * const *l, const char *prefix);