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 18:00:27 UTC
svn commit: r1537555 - /subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Author: breser
Date: Thu Oct 31 17:00:27 2013
New Revision: 1537555
URL: http://svn.apache.org/r1537555
Log:
Followup on r1537415: Put the bogus path back in the slash separated format.
* subversion/mod_dav_svn/mod_dav_svn.c
(dav_svn__translate_name): Not that much harder to just combine the
two without the helpers. During dev of the original change I switched
from apr_psprintf() to apr_pstrcat() which makes the NULLs ok, so the
only issue is avoiding a trailing slash. Switch back to NULL from
SVN_VA_NULL so the change can be backported. A separate commit after this
will restore that.
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=1537555&r1=1537554&r2=1537555&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 17:00:27 2013
@@ -1128,27 +1128,19 @@ static int dav_svn__translate_name(reque
fs_path = conf->fs_path;
}
- /* Before we can combine repos_path with fs_path need to make sure it isn't
- * NULL and to skip the leading '/' to "convert" it to a relpath appropriate
- * for joining. */
- if (!repos_path)
- repos_path = "";
- else if ('/' == *repos_path)
- repos_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;
/* Combine 'svn:', fs_path and repos_path to produce the bogus path we're
- * placing in r->filename.
- *
- * fs_path is a dirent, but repos_path is a relpath. In general it is safe
- * to join these, but when a path in a repository is 'trunk/c:hi' this
- * results in a non canonical dirent on Windows, so we can't use standard
- * helpers such as svn_dirent_join.
- *
- * As nobody should care about this path, just construct something simple
- * that makes sense when a user reads it in the log file.
- */
- r->filename = apr_pstrcat(r->pool,
- "svn:|", fs_path, "|", repos_path, SVN_VA_NULL);
+ * placing in r->filename. We can't use our standard join helpers such
+ * as svn_dirent_join. fs_path is a dirent and repos_path is a fspath
+ * (that can be trivially converted to a relpath by skipping the leading
+ * slash). In general it is safe to join these, but when a path in a
+ * 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);
/* Leave a note to ourselves so that we know not to decline in the
* map_to_storage hook. */