GNU bug report logs -
#6587
[PATCH] chcon, chmod, chown, du: don't translate "%s"
Previous Next
Reported by: Paul Eggert <eggert <at> CS.UCLA.EDU>
Date: Thu, 8 Jul 2010 18:42:01 UTC
Severity: normal
Tags: patch
Fixed in version 8.6
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 6587 <at> debbugs.gnu.org (full text, mbox):
Paul Eggert wrote:
> I noticed that du translates the string "%s". This doesn't make sense
> to me, and in looking at the translation files I notice that some
> translators were confused by this, and translated "%s" to "", thus
> causing the file names to be omitted in the output. Here is the
> obvious fix.
Thanks!
> Subject: [PATCH] chcon, chmod, chown, du: don't translate "%s"
>
> * src/chcon.c (process_file): Replace _("%s") with "%s".
> * src/chmod.c (process_file): Likewise.
> * src/chown-core.c (change_file_owner): Likewise.
> * src/du.c (process_file): Likewise.
>
> 2010-07-08 Paul Eggert <eggert <at> cs.ucla.edu>
> ---
> src/chcon.c | 2 +-
> src/chmod.c | 2 +-
> src/chown-core.c | 2 +-
> src/du.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/chcon.c b/src/chcon.c
> index 02f190d..5d0a86b 100644
> --- a/src/chcon.c
> +++ b/src/chcon.c
> @@ -257,7 +257,7 @@ process_file (FTS *fts, FTSENT *ent)
> break;
>
> case FTS_ERR:
> - error (0, ent->fts_errno, _("%s"), quote (file_full_name));
> + error (0, ent->fts_errno, "%s", quote (file_full_name));
That is a fine change. Please push it.
Though do note that I've tried (over the years) to eradicate
such uses of bare "%s", replacing each with a format string containing
%s and actual words telling what operation was being attempted or what
has failed. That is usually a lot more informative than a bare
"filename: strerror(errno)" diagnostic.
What makes it hard here is that (as I recall) fts_* can fail with
FTS_ERR in several different ways, so I punted and left it bare.
This bug report was last modified 14 years and 313 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.