summaryrefslogtreecommitdiff
path: root/subversion/libsvn_ra_local/split_url.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2013-11-11 01:00:29 +0000
committerPeter Wemm <peter@FreeBSD.org>2013-11-11 01:00:29 +0000
commit6573976d8d3ffbe3d00487ebc8c11e3eb4033f17 (patch)
treec05673887167c7ecd55a62ed72830f5186f453c1 /subversion/libsvn_ra_local/split_url.c
parent97551b2898eb459e9b616947d87d026d27b61518 (diff)
Diffstat (limited to 'subversion/libsvn_ra_local/split_url.c')
-rw-r--r--subversion/libsvn_ra_local/split_url.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/subversion/libsvn_ra_local/split_url.c b/subversion/libsvn_ra_local/split_url.c
index d08bb26aa760d..ec6cb68a94e72 100644
--- a/subversion/libsvn_ra_local/split_url.c
+++ b/subversion/libsvn_ra_local/split_url.c
@@ -39,6 +39,7 @@ svn_ra_local__split_URL(svn_repos_t **repos,
const char *repos_dirent;
const char *repos_root_dirent;
svn_stringbuf_t *urlbuf;
+ apr_size_t root_end;
SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dirent, URL, pool));
@@ -65,10 +66,17 @@ svn_ra_local__split_URL(svn_repos_t **repos,
"/",
svn_dirent_skip_ancestor(repos_root_dirent, repos_dirent),
(const char *)NULL); */
- *fs_path = &repos_dirent[strlen(repos_root_dirent)];
-
- if (**fs_path == '\0')
+ root_end = strlen(repos_root_dirent);
+ if (! repos_dirent[root_end])
*fs_path = "/";
+ else if (repos_dirent[root_end] == '/')
+ *fs_path = &repos_dirent[root_end];
+ else
+ {
+ /* On Windows "C:/" is the parent directory of "C:/dir" */
+ *fs_path = &repos_dirent[root_end-1];
+ SVN_ERR_ASSERT((*fs_path)[0] == '/');
+ }
/* Remove the path components after the root dirent from the original URL,
to get a URL to the repository root.