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

Re: svn commit: r11172 - trunk/subversion/svnlook

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-09-29 22:22:29 CEST

lundblad@tigris.org writes:

> Author: lundblad
> Date: Wed Sep 29 14:54:26 2004
> New Revision: 11172

> do_log (svnlook_ctxt_t *c, svn_boolean_t print_size, apr_pool_t *pool)
> {
> svn_string_t *prop_value;
> + svn_string_t *prop_value_native;
>
> - SVN_ERR (get_property (&prop_value, TRUE, c, SVN_PROP_REVISION_LOG, pool));
> + SVN_ERR (get_property (&prop_value, c, SVN_PROP_REVISION_LOG, pool));
> if (! (prop_value && prop_value->data))
> {
> SVN_ERR (svn_cmdline_printf (pool, "%s\n", print_size ? "0" : ""));
> @@ -1083,8 +1083,14 @@
> }
>
> if (print_size)
> - SVN_ERR (svn_cmdline_printf (pool, "%" APR_SIZE_T_FMT "\n",
> - prop_value->len));
> + {
> + /* svn_cmdline_printf will convert to the native locale and eol-style
> + for us, but we need the size of the converted message. */
> + SVN_ERR (svn_subst_detranslate_string (&prop_value_native, prop_value,
> + TRUE, pool));
> + SVN_ERR (svn_cmdline_printf (pool, "%" APR_SIZE_T_FMT "\n",
> + prop_value_native->len));
> + }
>
> SVN_ERR (svn_cmdline_printf (pool, "%s\n", prop_value->data));

Nearly, but not quite! This now fails to do EOL conversion on the
printed log message so multi-line log messages on non-LF systems won't
be correct, also since svn_subst_detranslate_string does do the EOL
conversion the lengths won't match.

How about calling svn_subst_detranslate_string unconditionally and
then using svn_stream_printf/write on prop_value_native?

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 29 22:22:56 2004

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.