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
@@ -64,13 +64,9 @@ static int add_modules(const char *p) {
if (!k)
return log_oom();
t = strv_merge(arg_proc_cmdline_modules, k);
if (!t)
if (strv_extend_strv(&arg_proc_cmdline_modules, k) < 0)
return log_oom();
strv_free(arg_proc_cmdline_modules);
arg_proc_cmdline_modules = t;
return 0;
}