nulstr-util: Declare NULSTR_FOREACH() iterator inline

This commit is contained in:
Daan De Meyer
2022-11-11 16:31:32 +01:00
parent 5ea173a91b
commit 12e2b70f9b
44 changed files with 26 additions and 78 deletions
+5 -5
View File
@@ -88,7 +88,7 @@ int fstab_filter_options(
char ***ret_values,
char **ret_filtered) {
const char *name, *namefound = NULL, *x;
const char *namefound = NULL, *x;
_cleanup_strv_free_ char **stor = NULL, **values = NULL;
_cleanup_free_ char *value = NULL, **filtered = NULL;
int r;
@@ -127,17 +127,17 @@ int fstab_filter_options(
if (!x)
continue;
/* Match name, but when ret_values, only when followed by assignment. */
if (*x == '=' || (!ret_values && *x == '\0'))
if (*x == '=' || (!ret_values && *x == '\0')) {
/* Keep the last occurrence found */
namefound = name;
goto found;
}
}
*t = *s;
t++;
continue;
found:
/* Keep the last occurrence found */
namefound = name;
if (ret_value || ret_values) {
assert(IN_SET(*x, '=', '\0'));