strv: convert strv_split_quotes into a generic strv_split_extract

strv_split_extract is to strv_split_quotes as extract_first_word was to
unquote_first_word.

Now there's extract_first_word for extracting a single argument,
extract_many_words for extracting a bounded number of arguments,
and strv_split_extract for extracting an arbitrary number of arguments.
This commit is contained in:
Richard Maw
2015-08-07 15:50:43 +00:00
parent ffcd3e89d5
commit 8adaf7bd23
7 changed files with 30 additions and 13 deletions
+1 -1
View File
@@ -550,7 +550,7 @@ char **replace_env_argv(char **argv, char **env) {
if (e) {
int r;
r = strv_split_quoted(&m, e, EXTRACT_RELAX);
r = strv_split_extract(&m, e, WHITESPACE, EXTRACT_RELAX|EXTRACT_QUOTES);
if (r < 0) {
ret[k] = NULL;
strv_free(ret);