[PATCH] find ! ... (operator -not)
Natanael Copa
natanael.copa at gmail.com
Tue Feb 6 07:50:33 PST 2007
vda,
Sorry for the delayed reply. I was sick since friday.
Thank for you comments. They were appreciated.
On Sun, 2007-02-04 at 18:10 +0100, Denis Vlasenko wrote:
> On Friday 02 February 2007 22:43, Denis Vlasenko wrote:
> > On Friday 02 February 2007 16:01, Natanael Copa wrote:
> > > Hi,
> > >
> > > Attatched is a patch for support of the '!' operator for find.
> > >
> > > I created another macro ALLOC_TEST for actions that can be inverted with
> > > '!'. They are not really actions (like -print) but tests (like -name).
> > >
> > > It should not touch anything unless you have enabled the
> > > FEATURE_FIND_NOT config option.
> >
> > parse_params():
> > invert_flag is never reset to 0. This must be a bug -
> > "not" shouldn't be applied to the second -name here, I think
> > (did not check it versus GNU find, tho...):
> > find ! -name '*.a' -o -name '*.b'
Correct. It was a bug.
> I did it myself. find ! support is in svn. Please test.
The bug is still there.
./busybox find ! -name '*.c' -name 'f*'
Should give you a lists of files starting with 'f' and with all .c files
excluded.
The attatched patch should fix it.
Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find-not-fix.patch
Type: text/x-patch
Size: 1280 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070206/8442e1fc/attachment.bin
More information about the busybox
mailing list