strv: make iterator in STRV_FOREACH() declaread in the loop

This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
This commit is contained in:
Yu Watanabe
2022-03-19 08:33:33 +09:00
parent 80a226b26b
commit de010b0b2e
210 changed files with 109 additions and 621 deletions
+1 -3
View File
@@ -91,7 +91,6 @@ static int do_execute(
_cleanup_hashmap_free_free_ Hashmap *pids = NULL;
_cleanup_strv_free_ char **paths = NULL;
char **path, **e;
int r;
bool parallel_execution;
@@ -254,7 +253,7 @@ int execute_directories(
}
static int gather_environment_generate(int fd, void *arg) {
char ***env = arg, **x, **y;
char ***env = arg;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_strv_free_ char **new = NULL;
int r;
@@ -369,7 +368,6 @@ static int gather_environment_consume(int fd, void *arg) {
int exec_command_flags_from_strv(char **ex_opts, ExecCommandFlags *flags) {
ExecCommandFlags ex_flag, ret_flags = 0;
char **opt;
assert(flags);