basic/strv: fix splitting of strings with escape characters

Plain strv_split() should not care if the strings contains backslashes
or quote characters. But extract_first_word() interprets backslashes
unless EXTRACT_RETAIN_ESCAPE is given.

I wonder how it's possible that nobody noticed this before. I think this
code was introduced in 0645b83a40.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-05-06 18:23:06 +02:00
parent 34c2d32cf9
commit b38a9d2d77
2 changed files with 16 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ int strv_split_full(char ***t, const char *s, const char *separators, ExtractFla
static inline char** strv_split(const char *s, const char *separators) {
char **ret;
if (strv_split_full(&ret, s, separators, 0) < 0)
if (strv_split_full(&ret, s, separators, EXTRACT_RETAIN_ESCAPE) < 0)
return NULL;
return ret;