--- Begin Message ---
Subject: |
Message incorrectly marked as c-format |
Date: |
Mon, 14 May 2012 20:15:59 +0200 |
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"
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#11472: Message src/fmt.c:285 marked as c-formatted string erroneously |
Date: |
Wed, 16 May 2012 07:33:00 +0200 |
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 <address@hidden>
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 address@hidden
Christian von Roques address@hidden
Christophe LYON address@hidden
Chuck Hedrick address@hidden
+Chusslove Illich address@hidden
Clark Morgan address@hidden
Clement Wang address@hidden
Colin Plumb address@hidden
@@ -482,6 +483,7 @@ Peter Horst address@hidden
Peter Moulder address@hidden
Peter Samuelson address@hidden
Peter Seebach address@hidden
+Petr Pisar address@hidden
Petr Uzel address@hidden
Petter Reinholdtsen address@hidden
Phelippe Neveu address@hidden
@@ -496,6 +498,7 @@ Piotr Gackiewicz address@hidden
Piotr Kwapulinski address@hidden
Prashant TR address@hidden
Priit Jõerüüt address@hidden
+Primoz PETERLIN address@hidden
Rainer Orth address@hidden
Ralf W. Stephan address@hidden
Ralph Loader address@hidden
@@ -593,6 +596,7 @@ Ton Nijkes address@hidden
Tony Kocurko address@hidden
Tony Leneis address@hidden
Tony Robinson address@hidden
+Toomas Soome address@hidden
Toralf Förster address@hidden
Torbjorn Granlund address@hidden
Torbjorn Lindgren address@hidden
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
--- End Message ---