You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/09/12 16:09:47 UTC

svn commit: r1383950 - in /subversion/branches/1.7.x-r1383483: ./ subversion/libsvn_ra_serf/serf.c

Author: cmpilato
Date: Wed Sep 12 14:09:47 2012
New Revision: 1383950

URL: http://svn.apache.org/viewvc?rev=1383950&view=rev
Log:
On the '1.7.x-r1383483' branch: merge from trunk r1383029.

Modified:
    subversion/branches/1.7.x-r1383483/   (props changed)
    subversion/branches/1.7.x-r1383483/subversion/libsvn_ra_serf/serf.c

Propchange: subversion/branches/1.7.x-r1383483/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1383029

Modified: subversion/branches/1.7.x-r1383483/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1383483/subversion/libsvn_ra_serf/serf.c?rev=1383950&r1=1383949&r2=1383950&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1383483/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/1.7.x-r1383483/subversion/libsvn_ra_serf/serf.c Wed Sep 12 14:09:47 2012
@@ -375,10 +375,12 @@ svn_ra_serf__open(svn_ra_session_t *sess
                                _("Illegal URL '%s'"),
                                session_URL);
     }
-  /* Contrary to what the comment for apr_uri_t.path says in apr-util 1.2.12 and
-     older, for root paths url.path will be "", where serf requires "/". */
+  /* Depending the version of apr-util in use, for root paths url.path
+     will be NULL or "", where serf requires "/". */
   if (url.path == NULL || url.path[0] == '\0')
-    url.path = apr_pstrdup(serf_sess->pool, "/");
+    {
+      url.path = apr_pstrdup(serf_sess->pool, "/");
+    }
   if (!url.port)
     {
       url.port = apr_uri_port_of_scheme(url.scheme);
@@ -477,9 +479,18 @@ svn_ra_serf__reparent(svn_ra_session_t *
                                _("Illegal repository URL '%s'"), url);
     }
 
-  /* Maybe we should use a string buffer for these strings so we don't
-     allocate memory in the session on every reparent? */
-  session->session_url.path = apr_pstrdup(session->pool, new_url.path);
+  /* Depending the version of apr-util in use, for root paths url.path
+     will be NULL or "", where serf requires "/". */
+  /* ### Maybe we should use a string buffer for these strings so we
+     ### don't allocate memory in the session on every reparent? */
+  if (new_url.path == NULL || new_url.path[0] == '\0')
+    {
+      session->session_url.path = apr_pstrdup(session->pool, "/");
+    }
+  else
+    {
+      session->session_url.path = apr_pstrdup(session->pool, new_url.path);
+    }
   session->session_url_str = apr_pstrdup(session->pool, url);
 
   return SVN_NO_ERROR;