mdev
Denys Vlasenko
vda.linux at googlemail.com
Mon Apr 13 23:19:27 UTC 2009
On Monday 13 April 2009 17:51, Vladimir Dronnikov wrote:
> >>
> >> How about a prefix char which means "do not stop on this rule
> >> even if it matches"? A-la Makefile's dash:
> >>
> >> -/sound root:audio 660 =snd/
> >> (audio|dsp|mixer) root:audio 666
> >>
> >
>
> Please, consider applying the patch.
# patch -p1 </tmp/mdev4.patch --dry-run
patching file util-linux/mdev.c
Hunk #1 succeeded at 65 (offset 2 lines).
Hunk #2 FAILED at 113.
Hunk #4 FAILED at 140.
Hunk #5 succeeded at 181 (offset 7 lines).
Hunk #7 succeeded at 244 (offset 7 lines).
Hunk #8 FAILED at 291.
3 out of 8 hunks FAILED -- saving rejects to file util-linux/mdev.c.rej
+ /* leading dash means do not stop at this line even if it matched */
+ char *val = tokens[0];
+ bool keep_matching = ('-' == val[0]);
+ val += keep_matching; // swallow leading dash
Note that this file uniformly uses /* */ comments.
I just moved the code which handles the match inside the loop,
and make loop exit conditional on '-'. This is not optimal,
since it tries to create the device multiple times,
but OTOH it is intuitively more clear - we "execute"
each matching line.
Please try current svn, let me know if it does not work for you.
--
vda
More information about the busybox
mailing list