[PATCH] find ! ... (operator -not)

Denis Vlasenko vda.linux at googlemail.com
Tue Feb 6 17:36:29 UTC 2007


On Tuesday 06 February 2007 16:56, Natanael Copa wrote:
> On Tue, 2007-02-06 at 16:50 +0100, Natanael Copa wrote:
> 
> > > > 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.
> 
> I'm sorry. I posted it a few seconds to early. The following chunk
> should not be there:
> @@ -342,7 +342,7 @@
>  	action*** appp;
>  	unsigned cur_group = 0;
>  	unsigned cur_action = 0;
> -	USE_FEATURE_FIND_NOT( smallint invert_flag = 0; )
> +	USE_FEATURE_FIND_NOT( smallint invert_flag; )
>  
>  	action* alloc_action(int sizeof_struct, action_fp f)
>  	{
> 
> 
> The invert_flag should be initialized.

Applied, thanks.
--
vda



More information about the busybox mailing list