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

Re: [PATCH] Broken translation strings since r28979

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Thu, 24 Jan 2008 16:25:30 -0500

Arfrever Frehtes Taifersar Arahesis <arfrever.fta_at_gmail.com> writes:
> I know. I only mentioned r28692 as an example of how to fix this bug.
>
> I'm attaching a patch to fix this bug.
>
> [[[
> * subversion/libsvn_fs_base/dag.c
> (svn_fs_base__dag_set_mergeinfo_count,
> svn_fs_base__dag_adjust_mergeinfo_count):
> * subversion/libsvn_fs_fs/dag.c
> (svn_fs_fs__dag_increment_mergeinfo_count):
> Pass translatable strings to apr_psprintf() function to create intermediate
> strings with appropriate format specifier.
>
> Found by: fabien
>
> Patch by: arfrever
> ]]]

Thanks! Did you build/test it? I haven't yet, but I just noticed
something reading the patch...

> --- subversion/libsvn_fs_fs/dag.c (wersja 29007)
> +++ subversion/libsvn_fs_fs/dag.c (kopia robocza)
> @@ -527,8 +527,10 @@
> svn_string_t *idstr = svn_fs_fs__id_unparse(node->id, pool);
> return svn_error_createf
> (SVN_ERR_FS_CORRUPT, NULL,
> - _("Can't increment mergeinfo count on node-revision %s to negative "
> - "value %" APR_INT64_T_FMT),
> + apr_psprintf(pool,
> + _("Can't increment mergeinfo count on node-revision %s "
> + "to negative value %%%s"),
> + APR_INT64_T_FMT),
> idstr->data, noderev->mergeinfo_count);
> }
> if (noderev->mergeinfo_count > 1 && noderev->kind == svn_node_file)
> @@ -536,8 +538,10 @@
> svn_string_t *idstr = svn_fs_fs__id_unparse(node->id, pool);
> return svn_error_createf
> (SVN_ERR_FS_CORRUPT, NULL,
> - _("Can't increment mergeinfo count on *file* node-revision %s to "
> - "%" APR_INT64_T_FMT " (> 1)"),
> + apr_psprintf(pool,
> + _("Can't increment mergeinfo count on *file* "
> + "node-revision %s to %%%s (> 1)"),
> + APR_INT64_T_FMT),
> idstr->data, noderev->mergeinfo_count);
> }

...in both of these cases, shouldn't the first "%s" be "%%s"? Or
another way: you could do the idstr->data substitution in the
apr_psprintf() instead of the svn_error_createf().

Either way works; but I think the current way does not.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-24 22:25:43 CET

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