Nathan Hartman wrote on Thu, 06 May 2021 17:31 +00:00:
> On Tue, Mar 16, 2021 at 3:08 AM <futat...@apache.org> wrote:
> > @@ -691,17 +691,20 @@ compare_p2l_to_rev(svn_fs_t *fs,
> >             * during later stages of the verification process. */
> >            if (   (entry->type == SVN_FS_FS__ITEM_TYPE_CHANGES)
> >                != (entry->item.number == SVN_FS_FS__ITEM_INDEX_CHANGES))
> > -            return svn_error_createf(SVN_ERR_FS_INDEX_CORRUPTION,
> > -                                     NULL,
> > -                                     _("p2l index entry for changes in"
> > -                                       " revision r%ld is item"
> > -                                       " %"APR_UINT64_T_FMT
> > -                                       " of type %u at offset %s"),
> > -                                     entry->item.revision,
> > -                                     entry->item.number,
> > -                                     (unsigned int)entry->type,
> > -                                     apr_off_t_toa(pool, offset));
> > -
> > +            {
> > +              const char *num_str = apr_psprintf(pool,
> > +                                                 "%" APR_UINT64_T_FMT,
> > +                                                 entry->item.number);
> > +              return svn_error_createf(SVN_ERR_FS_INDEX_CORRUPTION,
> > +                                       NULL,
> > +                                       _("p2l index entry for changes in"
> > +                                         " revision r%ld is item %s"
> > +                                         " of type %u at offset %s"),
> > +                                       entry->item.revision,
> > +                                       num_str,
> > +                                       (unsigned int)entry->type,
> > +                                       apr_off_t_toa(pool, offset));
> > +            }
> >            /* Check contents. */
> >            if (entry->type == SVN_FS_FS__ITEM_TYPE_UNUSED)
> >              {
> 
> 
> I must be missing something obvious, but I don't see what was broken
> about the way entry->item.number was formatted before?

The i18n tooling that extracts _("foo" "bar") string literals for
translation doesn't handle strings with macro expansions [1], so we jump
through the hoops of using %s instead.

[1] https://www.gnu.org/software/gettext/manual/gettext.html#Preparing-Strings, 
grep for «MYPRId64».

Reply via email to