You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/06/28 18:12:08 UTC

svn commit: r958619 - /subversion/trunk/subversion/libsvn_subr/dirent_uri.c

Author: rhuijben
Date: Mon Jun 28 16:12:08 2010
New Revision: 958619

URL: http://svn.apache.org/viewvc?rev=958619&view=rev
Log:
* subversion/libsvn_subr/dirent_uri.c
  (svn_uri_get_dirent_from_file_url): Dirents like //hostname generated
    from file://hostname are not valid, but file://localhost is. Add a
    test for this invalid format in the SVN_USE_DOS_PATHS specific code.

Modified:
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c

Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=958619&r1=958618&r2=958619&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Mon Jun 28 16:12:08 2010
@@ -2362,8 +2362,15 @@ svn_uri_get_dirent_from_file_url(const c
           }
       }
     if (hostname)
-      /* We still know that the path starts with a slash. */
-      *dirent = apr_pstrcat(pool, "//", hostname, dup_path, NULL);
+      {
+        if (dup_path[0] == '/' && dup_path[1] == '\0')
+          return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
+                                   _("Local URL '%s' contains only a hostname, "
+                                     "no path"), url);
+
+        /* We still know that the path starts with a slash. */
+        *dirent = apr_pstrcat(pool, "//", hostname, dup_path, NULL);
+      }
     else
       *dirent = dup_path;
   }