On Tue, Nov 12, 2024 at 11:10:04AM +0100, Miklos Szeredi wrote: > Filesystem options can be retrieved with STATMOUNT_MNT_OPTS, which > returns a string of comma separated options, where some characters are > escaped using the \OOO notation. > > Add a new flag, STATMOUNT_OPT_ARRAY, which instead returns the raw > option values separated with '\0' charaters. > > Since escaped charaters are rare, this inteface is preferable for > non-libmount users which likley don't want to deal with option > de-escaping. > > Example code: > > if (st->mask & STATMOUNT_OPT_ARRAY) { > const char *opt = st->str + st->opt_array; > > for (unsigned int i = 0; i < st->opt_num; i++) { > printf("opt_array[%i]: <%s>\n", i, opt); > opt += strlen(opt) + 1; > } > } > > Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx> > --- I'm likely going to snatch this for v6.13 still. I just need to reflow the code as the formatting is broken and maybe rename a few variables and need to wrap my head around the parsing. I'm testing this now.