]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fundamental: move strv_isempty() into src/fundamental/
authorLennart Poettering <lennart@amutable.com>
Wed, 25 Mar 2026 17:08:16 +0000 (18:08 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 27 Mar 2026 08:54:28 +0000 (09:54 +0100)
src/basic/strv.h
src/boot/boot.c
src/fundamental/strv-fundamental.h

index 7249d8a311767ced1b6add61bb8df9f2deeab2d6..d7c4b2bcf08edbf55202bcbb1a75fd8a558c4d41 100644 (file)
@@ -104,10 +104,6 @@ static inline const char* STRV_IFNOTNULL(const char *x) {
         return x ?: STRV_IGNORE;
 }
 
-static inline bool strv_isempty(char * const *l) {
-        return !l || !*l;
-}
-
 int strv_split_full(char ***t, const char *s, const char *separators, ExtractFlags flags);
 char** strv_split(const char *s, const char *separators);
 
index bffedf78e2928a880470d3d4583fbf9e0c8c8dc9..237e78c5a93604dbbf95ad4c2af3971f24e8bf32 100644 (file)
@@ -2547,7 +2547,7 @@ static EFI_STATUS initrd_prepare(
         assert(ret_initrd_pages);
         assert(ret_initrd_size);
 
-        if (entry->type != LOADER_LINUX || !entry->initrd) {
+        if (entry->type != LOADER_LINUX || strv_isempty(entry->initrd)) {
                 *ret_options = NULL;
                 *ret_initrd_pages = (Pages) {};
                 *ret_initrd_size = 0;
index 3abcdc4b02eead5685f0960a3ce4c9645850ef9c..7e7e34822f515824a8a2723c807fa9e265cdcf29 100644 (file)
@@ -2,9 +2,14 @@
 #pragma once
 
 #include "macro-fundamental.h"
+#include "string-util-fundamental.h"
 
 #define _STRV_FOREACH(s, l, i)                                          \
         for (typeof(*(l)) *s, *i = (l); (s = i) && *i; i++)
 
 #define STRV_FOREACH(s, l)                      \
         _STRV_FOREACH(s, l, UNIQ_T(i, UNIQ))
+
+static inline bool strv_isempty(sd_char * const *l) {
+        return !l || !*l;
+}