Subject: bug#11471: closed (Re: bug#11472: Message src/fmt.c:285 marked as c-formatted string erroneously)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 16 May 2012 05:34:02 +0000

Your bug report

#11470: Message incorrectly marked as c-format

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11470: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11470
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#11472: Message src/fmt.c:285 marked as c-formatted string erroneously
From: Jim Meyering <[email-masked]>
To: Eric Blake <[email-masked]>
Cc: [email-masked]
Date: Wed, 16 May 2012 07:33:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Eric Blake wrote:
> merge 11470 11472
> thanks
>
> On 05/14/2012 01:27 PM, Petr Pisar wrote:
>> The problem is such string does not pass through msgfmt tool while compiling
>> the catalog because the '% ' is not a valid printf sequence.
>>
>> Solution is to suppress the auto-detection by adding /*xgettext:no-c-format*/
>> before the fputs() line in the source code.
>
> Thanks.  You're the third person to report this today, but the first to
> provide a potential patch.  Are you comfortable submitting that fix in
> 'git format-patch' form with a proper commit message?  If not, we will
> probably do it on your behalf in the next 24 hours or so.

Thanks for all the replies and for merging those, Eric.

I wrote the patch.  As expected, it was more work to collect and
insert names in THANKS.in than to make the actual change ;-)
Note that Göran's name is already in the generated THANKS file,
so I didn't add it below.

If anyone listed prefers a different spelling of name or email,
just let us know.

>From 54be50197b47ba9200a1c3e48847fa959d4f5bfd Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Wed, 16 May 2012 07:26:36 +0200
Subject: [PATCH] maint: tell xgettext that fputs arg "93% of..." is not a C
 format string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* src/fmt.c (usage): Add a comment to tell
xgettext that the "% o" in fputs argument string of "...93% of..."
is not a C format string.  Reported by Toomas Soome, Göran Uddeborg,
Petr Pisar, Primoz PETERLIN and Chusslove Illich via
http://bugs.gnu.org/11470
---
 THANKS.in | 4 ++++
 src/fmt.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/THANKS.in b/THANKS.in
index 5c7dde8..6c826af 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -121,6 +121,7 @@ Christian Rose                      [email-masked]
 Christian von Roques                [email-masked]
 Christophe LYON                     [email-masked]
 Chuck Hedrick                       [email-masked]
+Chusslove Illich                    [email-masked]
 Clark Morgan                        [email-masked]
 Clement Wang                        [email-masked]
 Colin Plumb                         [email-masked]
@@ -482,6 +483,7 @@ Peter Horst                         [email-masked]
 Peter Moulder                       [email-masked]
 Peter Samuelson                     [email-masked]
 Peter Seebach                       [email-masked]
+Petr Pisar                          [email-masked]
 Petr Uzel                           [email-masked]
 Petter Reinholdtsen                 [email-masked]
 Phelippe Neveu                      [email-masked]
@@ -496,6 +498,7 @@ Piotr Gackiewicz                    [email-masked]
 Piotr Kwapulinski                   [email-masked]
 Prashant TR                         [email-masked]
 Priit Jõerüüt                       [email-masked]
+Primoz PETERLIN                     [email-masked]
 Rainer Orth                         [email-masked]
 Ralf W. Stephan                     [email-masked]
 Ralph Loader                        [email-masked]
@@ -593,6 +596,7 @@ Ton Nijkes                          [email-masked]
 Tony Kocurko                        [email-masked]
 Tony Leneis                         [email-masked]
 Tony Robinson                       [email-masked]
+Toomas Soome                        [email-masked]
 Toralf Förster                      [email-masked]
 Torbjorn Granlund                   [email-masked]
 Torbjorn Lindgren                   [email-masked]
diff --git a/src/fmt.c b/src/fmt.c
index 3da198e..3e93654 100644
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -281,10 +281,12 @@ Mandatory arguments to long options are mandatory for short options too.\n\
   -p, --prefix=STRING       reformat only lines beginning with STRING,\n\
                               reattaching the prefix to reformatted lines\n\
   -s, --split-only          split long lines, but do not refill\n\
 "),
              stdout);
+      /* Tell xgettext that the "% o" below is not a printf-style
+         format string:  xgettext:no-c-format */
       fputs (_("\
   -t, --tagged-paragraph    indentation of first line different from second\n\
   -u, --uniform-spacing     one space between words, two after sentences\n\
   -w, --width=WIDTH         maximum line width (default of 75 columns)\n\
   -g, --goal=WIDTH          goal width (default of 93% of width)\n\
--
1.7.10.2.520.g6a4a482

Subject: Message incorrectly marked as c-format
From: Göran Uddeborg <[email-masked]>
To: [email-masked]
Date: Mon, 14 May 2012 20:15:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

This message in the 8.17 message file is written using fputs(), but it
is anyway marked as c-format.  This is a problem since the % sign in
the description of --goal is taken as a formatting directive (of an
unsigned int written in octal, with the "space" flag).  This causes
problems when translating.  The effect of the validation of the
translation complains if the word following the percent sign doesn't
start with an "o", or other letter which is "compatible" in printf's
sense.  (And in Swedish I would like it to start with an "a".)

#: src/fmt.c:285
#, c-format
msgid ""
"  -t, --tagged-paragraph    indentation of first line different from second\n"
"  -u, --uniform-spacing     one space between words, two after sentences\n"
"  -w, --width=WIDTH         maximum line width (default of 75 columns)\n"
"  -g, --goal=WIDTH          goal width (default of 93% of width)\n"