[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Findutils-patches] [PATCH] Fix misleading error message when argume
From: |
James Youngman |
Subject: |
Re: [Findutils-patches] [PATCH] Fix misleading error message when argument to find -user is missing/unknown. |
Date: |
Tue, 23 Dec 2008 11:06:01 +0000 |
On Mon, Dec 22, 2008 at 12:53 PM, Eric Blake <address@hidden> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to address@hidden on 12/22/2008 2:49 AM:
>> if (uid_len && (username[uid_len]==0))
>> - uid = safe_atoi (username);
>> + {
>> + uid = safe_atoi (username);
>> + }
>
> Why the introduction of {} here?
Because the else-clause grew braces too. I prefer to keep those
balanced. Specifically, I use the no-brace construct
if (foo)
bar;
else
baz;
... only when both bar and baz are simple (not compound) statements.
>
>> else
>> - return false;
>> + {
>> + /* This is a fatal error (if we just return false, the caller
>> + * will say "invalid argument `username' to -user", which is
>> + * not as helpful). */
>> + if (username[0])
>> + {
>> + error (1, 0, _("%s is not the name of a known user."),
>
> GNU Coding Standards recommend that messages end without a trailing period.
Thanks for spotting that. Removed.
>> + error (1, 0, _("The argument to -user should not be
>> empty."));
>
> Likewise.
Also removed.
I pushed the result. Thanks for the comments.
James.