summaryrefslogtreecommitdiff
path: root/subversion/libsvn_subr/user.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2018-05-08 03:44:38 +0000
committerPeter Wemm <peter@FreeBSD.org>2018-05-08 03:44:38 +0000
commit3faf8d6bffc5d0fb2525ba37bb504c53366caf9d (patch)
tree7e47911263e75034b767fe34b2f8d3d17e91f66d /subversion/libsvn_subr/user.c
parenta55fb3c0d5eca7d887798125d5b95942b1f01d4b (diff)
Diffstat (limited to 'subversion/libsvn_subr/user.c')
-rw-r--r--subversion/libsvn_subr/user.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/subversion/libsvn_subr/user.c b/subversion/libsvn_subr/user.c
index 7d6d0bf0e1157..12d688707e039 100644
--- a/subversion/libsvn_subr/user.c
+++ b/subversion/libsvn_subr/user.c
@@ -28,6 +28,7 @@
#include "svn_user.h"
#include "svn_utf.h"
+#include "svn_dirent_uri.h"
/* Get the current user's name from the OS */
static const char *
@@ -68,8 +69,11 @@ svn_user_get_name(apr_pool_t *pool)
return utf8_or_nothing(username, pool);
}
-const char *
-svn_user_get_homedir(apr_pool_t *pool)
+/* Most of the guts of svn_user_get_homedir(): everything except
+ * canonicalizing the path.
+ */
+static const char *
+user_get_homedir(apr_pool_t *pool)
{
const char *username;
char *homedir;
@@ -84,3 +88,14 @@ svn_user_get_homedir(apr_pool_t *pool)
return NULL;
}
+
+const char *
+svn_user_get_homedir(apr_pool_t *pool)
+{
+ const char *homedir = user_get_homedir(pool);
+
+ if (homedir)
+ return svn_dirent_canonicalize(homedir, pool);
+
+ return NULL;
+}