bug-grep
[Top][All Lists]
Advanced

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

Re: grep-2.10 on OSF/1


From: Eric Blake
Subject: Re: grep-2.10 on OSF/1
Date: Mon, 21 Nov 2011 07:08:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 11/20/2011 06:11 AM, Bruno Haible wrote:
>       Fix test failures on OSF/1 5.1.
>       * tests/ignore-mmap: Pass a regular file, not /dev/null, to 'compare'.
>       * tests/max-count-vs-context: Likewise.

Autoconf learned that it is always more efficient to use 'test -s file'
rather than comparison against /dev/null when you are checking for
(non-)emptiness (one less fork, and in the case of buggy compare that
can't handle /dev/null, one less portability problem).

> +++ tests/max-count-vs-context        2011-11-20 14:08:59.000000000 +0100
> @@ -13,11 +13,12 @@
>  EOF
>  
>  sed 4q in > exp || framework_failure_
> +: > errexp || framework_failure_
>  
>  fail=0
>  grep -m1 -A5 needle in > out 2>err || fail=1
>  
>  compare out exp || fail=1
> -compare err /dev/null || fail=1
> +compare err errexp || fail=1

That is, rather than creating an empty errexp, I'd rather see this test
rewritten to use a form of test -s.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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