]> git.ipfire.org Git - thirdparty/systemd.git/commit
strv: add strv_split_colon_pairs function
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 7 Jul 2020 16:12:48 +0000 (17:12 +0100)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 5 Aug 2020 20:29:13 +0000 (21:29 +0100)
commita082edd53ac9da4a8e06281360754eb15bd1389f
tree071b655c2338f2055ca6b3b646c6728d10849f83
parent1e198efcdb1423847642e141c8b296e544707a18
strv: add strv_split_colon_pairs function

Given a string in the format 'one:two three four:five', returns a string
vector with each word. If the second element of the tuple is not
present, an empty string is returned in its place, so that the vector
can be processed in pairs.

[zjs: use EXTRACT_UNESCAPE_SEPARATORS instead of EXTRACT_CUNESCAPE_RELAX.
This way we do escaping exactly once and in normal strict mode.]
src/basic/strv.c
src/basic/strv.h
src/test/test-strv.c