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:
Simon Peeters
2014-01-05 09:16:15 -05:00
committed by Zbigniew Jędrzejewski-Szmek
parent bf85c24daa
commit e3e45d4f82
8 changed files with 97 additions and 279 deletions
+1 -5
View File
@@ -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;
}