[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r28368 - trunk/subversion/libsvn_repos

From: Dongsheng Song <dongsheng.song_at_gmail.com>
Date: 2007-12-15 16:41:24 CET

Yes, the current pot is bad:

#: ../libsvn_repos/reporter.c:168
msgid "Invalid length (%"
msgstr ""

If apply the following patch, it's good:

#: ../libsvn_repos/reporter.c:168
#, c-format
msgid "Invalid length (%%%s) when about to read a string"
msgstr ""

===================================================================
--- subversion/libsvn_repos/reporter.c (revision 28499)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -155,6 +155,7 @@
 {
   apr_uint64_t len;
   char *buf;
+ char *fmt;

   SVN_ERR(read_number(&len, temp, pool));

@@ -164,9 +165,10 @@
      string, anyone?) but let's be future-proof anyway. */
   if (len + 1 < len)
     {
+ fmt = apr_psprintf(pool, _("Invalid length (%%%s) when about to read
"
+ "a string"), APR_UINT64_T_FMT);
       return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
- _("Invalid length (%" APR_UINT64_T_FMT ") "
- "when about to read a string"), len);
+ fmt, len);
     }

   buf = apr_palloc(pool, len + 1);

Dongsheng

2007/12/15, Erik Huelsmann <ehuels@gmail.com>:
>
> On Dec 10, 2007 9:55 PM, Karl Fogel <kfogel@red-bean.com> wrote:
> > "Dongsheng Song" <dongsheng.song@gmail.com> writes:
> > > Could you use "llu" instead of "APR_UINT64_T_FMT", otherwise:
> > >
> > > $ ../../tools/po/po-update.sh zh_CN
> > > Building subversion.pot...
> > > ../libsvn_repos/reporter.c:168: warning: Although being used in a
> > > format string position, the msgid is not a valid C format string.
> > > Reason: The string ends in the middle of a directive.
> >
> > Hrm. I hate to not use the mechanism provided by APR for exactly this
> > purpose. Is there any way to shut off that warning for a specific
> > string?
>
> No. xgettext doesn't expand defines, so it doesn't know you're
> concatenating strings there.
>
> What we do in other places is: apr_psprintf the number into a string
> and insert the %s format specifier in the error string.
>
> HTH,
>
>
> Erik.
Received on Sat Dec 15 16:41:38 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.