util: Don't interpret quotes by default in extract_first_word

This adds an EXTRACT_QUOTES option to allow the previous behaviour, of
not interpreting any character inside ' or " quotes as separators.
This commit is contained in:
Richard Maw
2015-08-07 15:50:42 +00:00
parent 6868560773
commit 12ba2c44dd
8 changed files with 80 additions and 34 deletions
+2 -2
View File
@@ -662,7 +662,7 @@ static int parse_xattrs_from_arg(Item *i) {
for (;;) {
_cleanup_free_ char *name = NULL, *value = NULL, *xattr = NULL, *xattr_replaced = NULL;
r = extract_first_word(&p, &xattr, NULL, EXTRACT_CUNESCAPE);
r = extract_first_word(&p, &xattr, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE);
if (r < 0)
log_warning_errno(r, "Failed to parse extended attribute '%s', ignoring: %m", p);
if (r <= 0)
@@ -1763,7 +1763,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
r = extract_many_words(
&buffer,
NULL,
0,
EXTRACT_QUOTES,
&action,
&path,
&mode,