fundamental: move strv_isempty() into src/fundamental/

This commit is contained in:
Lennart Poettering
2026-03-27 09:54:28 +01:00
parent be176c0c91
commit 6e2a452118
3 changed files with 6 additions and 5 deletions
-4
View 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);
+1 -1
View 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;
+5
View 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;
}