strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include "systemctl.h"
|
||||
|
||||
static int normalize_filenames(char **names) {
|
||||
char **u;
|
||||
int r;
|
||||
|
||||
STRV_FOREACH(u, names)
|
||||
@@ -40,7 +39,6 @@ static int normalize_filenames(char **names) {
|
||||
}
|
||||
|
||||
static int normalize_names(char **names) {
|
||||
char **u;
|
||||
bool was_path = false;
|
||||
|
||||
STRV_FOREACH(u, names) {
|
||||
@@ -141,7 +139,6 @@ int verb_enable(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus;
|
||||
|
||||
if (STR_IN_SET(verb, "mask", "unmask")) {
|
||||
char **name;
|
||||
_cleanup_(lookup_paths_free) LookupPaths lp = {};
|
||||
|
||||
r = lookup_paths_init(&lp, arg_scope, 0, arg_root);
|
||||
|
||||
Reference in New Issue
Block a user