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

Reply via email to