[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] df: fail when the mount list cannot be read but is needed [w
From: |
Bernhard Voelker |
Subject: |
Re: [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4] |
Date: |
Tue, 14 Aug 2012 12:50:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 |
On 08/14/2012 11:31 AM, Jim Meyering wrote:
> Actually, I realized that we should remove the latter "optind < argc"
> conjunct. Because in the RHS of the outer "||", that expression is already
> guaranteed to be true. I.e.,
>
> diff --git a/src/df.c b/src/df.c
> index a2e6866..9d956cd 100644
> --- a/src/df.c
> +++ b/src/df.c
> @@ -1104,12 +1104,11 @@ main (int argc, char **argv)
> or when either of -a, -l, -t or -x is used with file name
> arguments. Otherwise, merely give a warning and proceed. */
> int status = 0;
> - if ( !(optind < argc)
> - ||(optind < argc
> - && (show_all_fs
> - || show_local_fs
> - || fs_select_list != NULL
> - || fs_exclude_list != NULL)))
> + if ( ! (optind < argc)
> + || (show_all_fs
> + || show_local_fs
> + || fs_select_list != NULL
> + || fs_exclude_list != NULL))
> {
> status = EXIT_FAILURE;
> }
I derived the expression from the natural wording (see the comment),
therefore that excess condition was still there.
Looks even better now. Thanks.
Have a nice day,
Berny
- Re: new snapshot available: coreutils-8.17.70-1bacb4, (continued)
- Re: new snapshot available: coreutils-8.17.70-1bacb4, Jim Meyering, 2012/08/08
- Re: new snapshot available: coreutils-8.17.70-1bacb4, Bernhard Voelker, 2012/08/08
- Re: new snapshot available: coreutils-8.17.70-1bacb4, Pádraig Brady, 2012/08/08
- Re: new snapshot available: coreutils-8.17.70-1bacb4, Bernhard Voelker, 2012/08/08
- Re: new snapshot available: coreutils-8.17.70-1bacb4, Jim Meyering, 2012/08/08
- [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4], Bernhard Voelker, 2012/08/09
- Re: [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4], Bernhard Voelker, 2012/08/14
- Re: [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4], Jim Meyering, 2012/08/14
- Re: [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4], Bernhard Voelker, 2012/08/14
- Re: [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4], Jim Meyering, 2012/08/14
- Re: [PATCH] df: fail when the mount list cannot be read but is needed [was: new snapshot available: coreutils-8.17.70-1bacb4],
Bernhard Voelker <=