[systemd-devel] [PATCH v2, ping?] tmpfiles, man: Add xattr support to tmpfiles

Lennart Poettering lennart at poettering.net
Thu Jul 18 11:25:11 PDT 2013

On Thu, 18.07.13 17:09, Maciej Wereski (m.wereski at partner.samsung.com) wrote:

> Hello,
> 16.07.2013 at 00:31 Lennart Poettering <lennart at poettering.net> wrote:
> >>+        STRV_FOREACH(x, i->xattrs) {
> >>+                value = *x;
> >>+                name = strsep(&value, "=");
> >
> >I'd really prefer if we didn't corrupt the string here. Maybe use
> >strv_split_quoted() here? That handles all the values for you anyway...
> You mean strv_split() (I'm splitting by "=")? This has one issue: it
> splits by all separator occurrences and I need to split after first one.
> If corrupting string is the issue, I can make a copy of it. If you prefer
> strv_split(), then I can just join if strv_length > 2.

Oh, true.

Given that this appears to be recurring theme I have now added a
split_pair() call for you. It will split a string up at a specified
separator into a pair. You could then pass the second argument into
unquote() and that's all you need?

Could you please rework your patch with that?


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list