mirror of
https://github.com/systemd/systemd.git
synced 2026-08-07 08:30:57 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user