summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-22 00:37:32 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-22 00:37:32 +0000
commit9e44f56b4ecfa47e27380165b834bd71aa403b78 (patch)
tree81f49c948ac6db3b9dc44a466679bcb076818a38 /src/test/test-util.c
parent2dcc3c69a10f76e0ee9185c863d23ee62d481919 (diff)
downloadsystemd-9e44f56b4ecfa47e27380165b834bd71aa403b78.tar.gz
util: allow unbalanced double quote in EXTRACT_QUOTES|EXTRACT_RELAX mode
extract_first_word understands "\'string" but doesn't understand "\"string" fixed this inconsistency.
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r--src/test/test-util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 503e840803..b5d9d01ba0 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1639,6 +1639,12 @@ static void test_extract_first_word(void) {
free(t);
assert_se(isempty(p));
+ p = original = "\"fooo";
+ assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0);
+ assert_se(streq(t, "fooo"));
+ free(t);
+ assert_se(isempty(p));
+
p = original = "yay\'foo\'bar";
assert_se(extract_first_word(&p, &t, NULL, 0) > 0);
assert_se(streq(t, "yay\'foo\'bar"));