You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/10/31 22:45:39 UTC
svn commit: r1537700 - /subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Author: breser
Date: Thu Oct 31 21:45:39 2013
New Revision: 1537700
URL: http://svn.apache.org/r1537700
Log:
mod_dav_svn: Deal with some edge cases on producing the bogus path for r->filename.
* subversion/mod_dav_svn/mod_dav_svn.c
(dav_svn__translate_name): dav_svn_split_uri() doesn't actually reliably give
you an fspath but sometimes it's just a relpath (difference being leading /).
Workaround this in a backportable way.
Modified:
subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Modified: subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c?rev=1537700&r1=1537699&r2=1537700&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c Thu Oct 31 21:45:39 2013
@@ -1100,7 +1100,7 @@ static int dav_svn__handler(request_rec
* that %f in logging formats will show as "svn:/path/to/repo/path/in/repo". */
static int dav_svn__translate_name(request_rec *r)
{
- const char *fs_path, *repos_basename, *repos_path;
+ const char *fs_path, *repos_basename, *repos_path, *slash;
const char *ignore_cleaned_uri, *ignore_relative_path;
int ignore_had_slash;
dav_error *err;
@@ -1128,9 +1128,17 @@ static int dav_svn__translate_name(reque
fs_path = conf->fs_path;
}
- /* Avoid a trailing slash on the bogus path when repos_path is just "/" */
- if (repos_path && '/' == repos_path[0] && '\0' == repos_path[1])
- repos_path = NULL;
+ /* Avoid a trailing slash on the bogus path when repos_path is just "/" and
+ * ensure that there is always a slash between fs_path and repos_path as
+ * long as the repos_path is not an empty path. */
+ slash = "";
+ if (repos_path)
+ {
+ if ('/' == repos_path[0] && '\0' == repos_path[1])
+ repos_path = NULL;
+ else if ('/' != repos_path[0] && '\0' != repos_path[0])
+ slash = "/";
+ }
/* Combine 'svn:', fs_path and repos_path to produce the bogus path we're
* placing in r->filename. We can't use our standard join helpers such
@@ -1140,7 +1148,7 @@ static int dav_svn__translate_name(reque
* repository is 'trunk/c:hi' this results in a non canonical dirent on
* Windows. Instead we just cat them together. */
r->filename = apr_pstrcat(r->pool,
- "svn:", fs_path, repos_path, NULL);
+ "svn:", fs_path, slash, repos_path, NULL);
/* Leave a note to ourselves so that we know not to decline in the
* map_to_storage hook. */