fundamental: move strv_isempty() into src/fundamental/
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user