kfogel@tigris.org wrote:
>Author: kfogel
>Date: Fri Feb 4 15:11:50 2005
>New Revision: 12919
>
>
>Modified: trunk/subversion/libsvn_subr/utf.c
>Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_subr/utf.c?view=diff&rev=12919&p1=trunk/subversion/libsvn_subr/utf.c&r1=12918&p2=trunk/subversion/libsvn_subr/utf.c&r2=12919
>==============================================================================
>--- trunk/subversion/libsvn_subr/utf.c (original)
>+++ trunk/subversion/libsvn_subr/utf.c Fri Feb 4 15:11:50 2005
>@@ -725,6 +725,9 @@
> {
> if (! apr_isascii (*src_orig))
>
>
Shouldn't this be svn_ctype_isascii?
>@@ -265,6 +266,58 @@
> xml_escape_attr (outstr, string, (apr_size_t) strlen (string), pool);
> }
>
>+
>+const char *
>+svn_xml_fuzzy_escape (const char *string, apr_pool_t *pool)
>+{
>+ const char *end = string + strlen (string);
>+ const char *p = string, *q;
>+ svn_stringbuf_t *outstr;
>+ char escaped_char[6]; /* ? \ u u u \0 */
>+
>+ for (q = p; q < end; q++)
>+ {
>+ if (svn_ctype_iscntrl (*q)
>+ && ! ((*q == '\n') || (*q == '\r') || (*q == '\t')))
>
>
These are UTF-8 strings, so you should define character value constants
in svn_ctype.h and use them here.
>+ break;
>+ }
>+
>+ /* Return original string if no unsafe characters found. */
>+ if (q == end)
>+ return string;
>+
>+ outstr = svn_stringbuf_create ("", pool);
>+ while (1)
>+ {
>+ q = p;
>+
>+ /* Traverse till either unsafe character or eos. */
>+ while ((q < end)
>+ && ((! svn_ctype_iscntrl (*q))
>+ || (*q == '\n') || (*q == '\r') || (*q == '\t')))
>
>
Same here. and abstract this not-copy-pasted but semantically identical
code. :-)
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Feb 5 00:36:47 2005