[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] Re: [PATCH 06/19] Avoid false positives for the sc_p

From: Eric Blake
Subject: [Findutils-patches] Re: [PATCH 06/19] Avoid false positives for the sc_prohibit_test_minus_ao syntax check.
Date: Fri, 02 Apr 2010 16:56:05 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

On 04/02/2010 04:47 PM, James Youngman wrote:
> -find subdir -newer timestamp -a \
> -     -exec test @address@hidden -nt timestamp \; -a \
> +find subdir -newer timestamp -and \
> +     -exec test @address@hidden -nt timestamp \; -and \

Good - in this case, the -a was an argument of find(1), not test(1), and
find(1) also understands -and.

> -find repo/ -exec test -d @address@hidden/.svn -o -d @address@hidden/.git -o 
> -d @address@hidden/CVS \; -print -prune
> +find repo/ -exec test -d @address@hidden/.svn -or -d @address@hidden/.git 
> -or -d @address@hidden/CVS \; -print -prune

Oops.  That was a real case of test(1) being passed -o.  Shouldn't this
be more like:

find repo/ -exec test -d @address@hidden/.svn \; -or -exec test -d 
@address@hidden/.git \; -or
-exec test -d @address@hidden/CVS \; -print -prune

or even:

find repo/ -exec sh -c 'test -d "$1".svn || test -d "$1".git || test -d
"$1"/CVS' sh @address@hidden \; -print -prune

> -.B find repo/ -exec test -d {}/.svn -o -d {}/.git -o -d {}/CVS \; \e
> +.B find repo/ -exec test -d {}/.svn -or -d {}/.git -or -d {}/CVS \; \e

Same example and therefore same bug, but in roff markup instead of texinfo.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]