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

Re: svn commit: rev 3662 - trunk/subversion/mod_dav_svn trunk/subversion/tests/clients/cmdline/svntest

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-11-07 20:48:52 CET

philip@tigris.org wrote:

>Modified: trunk/subversion/mod_dav_svn/update.c
>==============================================================================
>--- trunk/subversion/mod_dav_svn/update.c (original)
>+++ trunk/subversion/mod_dav_svn/update.c Tue Nov 5 17:53:50 2002
>@@ -454,7 +454,8 @@
> }
> #undef NSLEN
>
>- qname = apr_xml_quote_string (b->pool, name, 1);
>+ /* apr_xml_quote_string doesn't realloc if there is nothing to quote */
>+ qname = apr_xml_quote_string (b->pool, apr_pstrdup (b->pool, name), 1);
> if (value)
> {
> if (! b->changed_props)
>
>

How about this patch instead?

Index: subversion/mod_dav_svn/update.c
===================================================================
--- subversion/mod_dav_svn/update.c (revision 3683)
+++ subversion/mod_dav_svn/update.c (working copy)
@@ -454,8 +454,11 @@
     }
 #undef NSLEN

- /* apr_xml_quote_string doesn't realloc if there is nothing to quote */
- qname = apr_xml_quote_string (b->pool, apr_pstrdup (b->pool, name), 1);
+ qname = apr_xml_quote_string (b->pool, name, 1);
+ /* apr_xml_quote_string doesn't realloc if there is nothing to
+ quote, so dup the name only if necessary. */
+ if (qname == name)
+ qname = apr_pstrdup (b->pool, name);
   if (value)
     {
       if (! b->changed_props)
Index: subversion/libsvn_ra_dav/log.c
===================================================================
--- subversion/libsvn_ra_dav/log.c (revision 3683)
+++ subversion/libsvn_ra_dav/log.c (working copy)
@@ -25,6 +25,7 @@
 #include <apr_tables.h>
 #include <apr_strings.h>
 #include <apr_portable.h>
+#include <apr_xml.h>

 #include <ne_basic.h>
 #include <ne_utils.h>
@@ -364,13 +365,11 @@

   for (i = 0; i < paths->nelts; i++)
     {
- const char *this_path = ((const char **)paths->elts)[i];
- /* ### todo: want to xml-escape the path, but can't use
- apr_xml_quote_string() here because we don't use apr_util
- yet. Should use svn_xml_escape_blah() instead? */
- svn_stringbuf_appendcstr(request_body,
- apr_psprintf(ras->pool,
- "<S:path>%s</S:path>", this_path));

+ const char *this_path =
+ apr_xml_quote_string(ras->pool, ((const char **)paths->elts)[i], 1);
+ svn_stringbuf_appendcstr(request_body, "<S:path>");
+ svn_stringbuf_appendcstr(request_body, this_path);
+ svn_stringbuf_appendcstr(request_body, "</S:path>");
     }

   svn_stringbuf_appendcstr(request_body, log_request_tail);

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 7 20:49:50 2002

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.