PATCH: mount -O list
Denys Vlasenko
vda.linux at googlemail.com
Fri Dec 4 02:34:31 UTC 2009
On Thursday 03 December 2009 08:11, Michael Abbott wrote:
> On Thu, 3 Dec 2009, Denys Vlasenko wrote:
> > On Tuesday 01 December 2009 10:30, Michael Abbott wrote:
> > > The attached patch implements support for a list of filter options on the
> > > -O option.
> > >
> > > I have assumed that when
> > > -O a,nob,c
> > > is requested that this should be interpreted as requiring that both -o a
> > > and -o c are specified, as well as that -o b is *not* specified.
> > > Unfortunately the mount man page is annoyingly ambiguous on this.
> >
> > Can you determine that experimentally?
>
> Well, a fairly quick experiment with Debian's mount seems to confirm my
> interpretation: -O a,nob only succeeds if -o a is present and not -o b,
> so I've attached an updated patch to address your comments below.
>
>
> > > diff -ur busybox-1.15.2/util-linux/mount.c busybox-1.15.2-patched/util-linux/mount.c
> > > --- busybox-1.15.2/util-linux/mount.c 2009-10-08 01:59:09.000000000 +0100
> > > +++ busybox-1.15.2-patched/util-linux/mount.c 2009-12-01 09:19:07.000000000 +0000
> ...
> > > + while (*O_opt)
> > > + {
> >
> > misplaced brace
>
> Huh. Yes, at least I got the rest right ;) Not my normal coding style
> (nor all those tabs: I vote to abolish ASCII code point 9 altogether).
>
> I gather that busybox coding style is "like the rest of the file"?
>
> ...
> > > + if (match)
> > > + return 0; // no match selected, but option found
> > > + else {
> >
> > "else" after "return" can be omitted.
>
> Yes. Again I prefer the two arms of my branches to be explicit where
> possible (a more "functional" style, if you like), but text parsing is
> always clunky and concision should win.
>
> ...
> > > + if (O_comma)
> > > + O_opt = O_comma + 1;
> > > + else
> > > break;
> >
> > Perhaps the other way around:
>
> Inevitably!
>
> Ok, here's an improved patch.
Applied with some editing. Thanks!
Please try current git.
--
vda
More information about the busybox
mailing list