subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1139410 - in /subversion/trunk/subversion: libsvn_subr/dirent_uri.c tests/libsvn_subr/dirent_uri-test.c
Date Fri, 24 Jun 2011 19:05:26 GMT
Author: rhuijben
Date: Fri Jun 24 19:05:26 2011
New Revision: 1139410

URL: http://svn.apache.org/viewvc?rev=1139410&view=rev
Log:
Make svn_uri_get_file_url_from_dirent() return the canonical form file:// for
"/" instead of the not canonical "file:///".

Found by looking at the failed tests caused by r1139372: I expected
"file:///" to be the canonical form, while the error showed "file://".

* subversion/libsvn_subr/dirent_uri.c
  (svn_uri_get_file_url_from_dirent): Handle "/" specifically.

* subversion/tests/libsvn_subr/dirent_uri-test.c
  (test_file_url_from_dirent): Update expected result.

Modified:
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c
    subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.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=1139410&r1=1139409&r2=1139410&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Fri Jun 24 19:05:26 2011
@@ -2407,6 +2407,9 @@ svn_uri_get_file_url_from_dirent(const c
   dirent = svn_path_uri_encode(dirent, pool);
 
 #ifndef SVN_USE_DOS_PATHS
+  if (dirent[0] == '/' && dirent[1] == '\0')
+    dirent = NULL; /* "file://" is the canonical form of "file:///" */
+
   *url = apr_pstrcat(pool, "file://", dirent, (char *)NULL);
 #else
   if (dirent[0] == '/')

Modified: subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1139410&r1=1139409&r2=1139410&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c Fri Jun 24 19:05:26 2011
@@ -2492,7 +2492,7 @@ test_file_url_from_dirent(apr_pool_t *po
 #else
     { "/a/b",                      "file:///a/b" },
     { "/a",                        "file:///a" },
-    { "/",                         "file:///" },
+    { "/",                         "file://" },
     { "/File#$",                   "file:///File%23$" },
 #endif
   };



Mime
View raw message