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

[PATCH] Make gettext extract a msgid correctly (Re: [l10n] the msgid is not a valid C format string)

From: Kobayashi Noritada <nori1_at_dolphin.c.u-tokyo.ac.jp>
Date: 2007-03-24 17:12:24 CET

Hi again,

From: Kobayashi Noritada
Subject: [l10n] the msgid is not a valid C format string
Date: Sat, 24 Mar 2007 23:47:26 +0900 (JST)

> After the merge of the sparse-directories branch into trunk,
> a following warning appears with gettext:
>
> nori1[23:12]% LC_ALL=C make locale-gnu-po-update PO=ja
> cd /home/nori1/svnwc/subversion-trunk && XGETTEXT="/home/nori1/bin/xgettext" MSGMERGE="/home/nori1/bin/msgmerge" \
> tools/po/po-update.sh ja
> Building subversion.pot...
> ./libsvn_repos/reporter.c:218: 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.
> Updating ja.po...
> ............................................................................................................................................................ done.
> ............................................................................................................................................................ done.
>
>
> ... which is due to code like this:
>
> return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
> _("Invalid depth (%"
> APR_UINT64_T_FMT
> ") for path '%s'"),
> num, (*pi)->path);
>
>
> ... and results in a ill-formatted msgid like this:
>
> msgid "Invalid depth (%"
>
>
> Could you please work around it?
> (I'm sorry I cannot create a patch to fix it...)

Hmm..., I was too pessimistic. Does a patch attached to this mail work well?

Thanks,

-nori

[[[
* subversion/libsvn_repos/reporter.c
  (read_path_info): Make gettext parse a C format string and extract
  a msgid correctly.
]]]

Index: subversion/libsvn_repos/reporter.c
===================================================================
--- subversion/libsvn_repos/reporter.c (revision 24000)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -174,6 +174,7 @@
 read_path_info(path_info_t **pi, apr_file_t *temp, apr_pool_t *pool)
 {
   char c;
+ const char *depth;
 
   SVN_ERR(svn_io_file_getc(&c, temp, pool));
   if (c == '-')
@@ -214,11 +215,10 @@
              svn_depth_infinity as "3" here, because that's the
              default and should never be sent. */
         default:
+ depth = apr_psprintf(pool, "%" APR_UINT64_T_FMT "", num);
           return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
- _("Invalid depth (%"
- APR_UINT64_T_FMT
- ") for path '%s'"),
- num, (*pi)->path);
+ _("Invalid depth (%s) for path '%s'"),
+ depth, (*pi)->path);
         }
     }
   else

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 24 17:12:40 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.