subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1692269 - in /subversion/trunk/subversion: libsvn_subr/dirent_uri.c tests/libsvn_subr/dirent_uri-test.c
Date Wed, 22 Jul 2015 13:13:18 GMT
Author: rhuijben
Date: Wed Jul 22 13:13:17 2015
New Revision: 1692269

URL: http://svn.apache.org/r1692269
Log:
Following up on r1692262, fix canonicalizing the separator directly behind
a windows drive letter usage.

If the separator in this location was %2F it wouldn't be converted to '/',
unlike in other locations of the url... instead it would be converted to %25,
which is the escaped version of '%'.

* subversion/libsvn_subr/dirent_uri.c
  (canonicalize): Handle a final '/' in the same way as the generic code.

* subversion/tests/libsvn_subr/dirent_uri-test.c
  (uri_canonical_tests): Extend testcase.

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=1692269&r1=1692268&r2=1692269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Wed Jul 22 13:13:17 2015
@@ -507,8 +507,8 @@ canonicalize(path_type_t type, const cha
               dst += seglen - 2;
             }
 
-          if (*next)
-            *(dst++) = *next;
+          if (slash_len)
+            *(dst++) = '/';
           canon_segments++;
         }
 #endif /* SVN_USE_DOS_PATHS */

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=1692269&r1=1692268&r2=1692269&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c Wed Jul 22 13:13:17 2015
@@ -904,24 +904,36 @@ static const testcase_canonicalize_t uri
     { "https://[::1]:443",     "https://[::1]" },
     { "http://[FACE:B00C::]/s","http://[face:b00c::]/s" },
     { "svn+ssh://b@[1:2::3]/s","svn+ssh://b@[1:2::3]/s" },
+    { "file:///A%2f%2Fb%2fc",  "file:///A/b/c"},
+    { "file:///A%2fb%2f%2Fc",  "file:///A/b/c"},
 #ifdef SVN_USE_DOS_PATHS
     { "file:///c:/temp/repos", "file:///C:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///c:/",           "file:///C:" },
+    { "file:///c:%2ftemp",     "file:///C:/temp"},
     { "file:///C:hi",          "file:///C:hi" },
     { "file:///c:hi",          "file:///C:hi" },
     { "file:///C:hi/Q",        "file:///C:hi/Q" },
     { "file:///c:hi/q",        "file:///C:hi/q" },
+    { "file:///c:hi%2fD",      "file:///C:hi/D" },
+    { "file:///c:hi%25/A",     "file:///C:hi%25/A"},
+    { "file:///c:hi%2E/A",     "file:///C:hi./A"},
+    { "file:///c:hi%/A",       "file:///C:hi%25/A"},
 #else /* !SVN_USE_DOS_PATHS */
     { "file:///c:/temp/repos", "file:///c:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///c:/",           "file:///c:" },
+    { "file:///c:%2ftemp",     "file:///C:/temp"},
     { "file:///C:hi",          "file:///C:hi" },
     { "file:///c:hi",          "file:///c:hi" },
     { "file:///C:hi/Q",        "file:///C:hi/Q" },
     { "file:///c:hi/q",        "file:///c:hi/q" },
+    { "file:///c:hi%2fD",      "file:///c:hi/D" },
+    { "file:///c:hi%25/A",     "file:///c:hi%25/A" }
+    { "file:///c:hi%2E/A",     "file:///c:hi./A"}
+    { "file:///c:hi%/A",       "file:///c:hi%25/A"},
 #endif /* SVN_USE_DOS_PATHS */
     /* Hostnames that look like non-canonical paths */
     { "file://./foo",             "file://./foo" },



Mime
View raw message