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

Re: Observations relating to r15828.

From: <kfogel_at_collab.net>
Date: 2005-08-22 22:27:43 CEST

Philip Martin <philip@codematters.co.uk> writes:
> 4. Property encoding
>
> append_prop_conflict assumes that the property values are valid
> UTF8. It's possible to have properties that are not UTF8 and
> append_prop_conflict will fail, and so the merge will abort.
> Perhaps we should escape non-UTF8 values, or simply write them
> without conversion?

How does this patch look to you?

[[[
* subversion/libsvn_wc/props.c
  (append_prop_conflict): Convert conflict description from utf8 to
  native fuzzily, since robustness is more important than accuracy.

Suggested by: philip
]]]

Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c (revision 15884)
+++ subversion/libsvn_wc/props.c (working copy)
@@ -218,16 +218,13 @@
   /* TODO: someday, perhaps prefix each conflict_description with a
      timestamp or something? */
   apr_size_t written;
- const svn_string_t *conflict_description_native;
+ const char *conflict_description_native =
+ svn_utf_cstring_from_utf8_fuzzy (conflict_description->data, pool);
 
- SVN_ERR (svn_utf_string_from_utf8 (&conflict_description_native,
- conflict_description,
- pool));
+ SVN_ERR (svn_io_file_write_full (fp, conflict_description_native,
+ strlen (conflict_description_native),
+ &written, pool));
 
- SVN_ERR (svn_io_file_write_full (fp, conflict_description_native->data,
- conflict_description_native->len, &written,
- pool));
-
   return SVN_NO_ERROR;
 }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 22 23:26:53 2005

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.