strv: multiple cleanups
- turn strv_merge into strv_extend_strv. appending strv b to the end of strv a instead of creating a new strv - strv_append: remove in favor of strv_extend and strv_push. - strv_remove: write slightly more elegant - strv_remove_prefix: remove unused function - strv_overlap: use strv_contains - strv_printf: STRV_FOREACH handles NULL correctly
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
bf85c24daa
commit
e3e45d4f82
+1
-5
@@ -251,13 +251,9 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
if (*p == '.')
|
||||
*p = '/';
|
||||
|
||||
l = strv_append(arg_prefixes, optarg);
|
||||
if (!l)
|
||||
if (strv_extend(&arg_prefixes, optarg) < 0)
|
||||
return log_oom();
|
||||
|
||||
strv_free(arg_prefixes);
|
||||
arg_prefixes = l;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user