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

Re: svn commit: r12919 - in trunk/subversion: include libsvn_subr mod_dav_svn tests/clients/cmdline

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-02-05 00:35:40 CET

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

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