On Thu, 18.07.13 17:09, Maciej Wereski (m.were...@partner.samsung.com) wrote:
> > Hello, > > 16.07.2013 at 00:31 Lennart Poettering <lenn...@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 -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel