summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-06-10 19:53:28 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-06-10 19:53:28 +0000
commit08d6e25e1e46d0198f130ee6f3503701ccb9ecce (patch)
tree4f4ced9555f1892ceeeecb8c1b1118f552b5549a /user
parente98dc24ea40764719373e044a1ff26adcd037af0 (diff)
downloadlibapr-08d6e25e1e46d0198f130ee6f3503701ccb9ecce.tar.gz
Better make the path canonical to unixish expectations.
This is verified to allow mod_userdir do it's thing on win32. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61749 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r--user/win32/userinfo.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
index 38dcf7fe3..70390d0fd 100644
--- a/user/win32/userinfo.c
+++ b/user/win32/userinfo.c
@@ -106,6 +106,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
apr_oslevel_e os_level;
apr_status_t rv;
char regkey[MAX_PATH * 2];
+ char *fixch;
DWORD keylen;
DWORD type;
HKEY key;
@@ -149,7 +150,6 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
(apr_wchar_t*)regkey)) != APR_SUCCESS)
return rv;
*dirname = apr_pstrdup(p, retdir);
- return APR_SUCCESS;
}
else if (type == REG_EXPAND_SZ) {
apr_wchar_t path[MAX_PATH];
@@ -159,9 +159,9 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
!= APR_SUCCESS)
return rv;
*dirname = apr_pstrdup(p, retdir);
- return APR_SUCCESS;
}
- return APR_ENOENT;
+ else
+ return APR_ENOENT;
}
else
#endif APR_HAS_UNICODE_FS
@@ -174,16 +174,18 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
return APR_FROM_OS_ERROR(rv);
if (type == REG_SZ) {
*dirname = apr_pstrdup(p, regkey);
- return APR_SUCCESS;
}
else if (type == REG_EXPAND_SZ) {
char path[MAX_PATH];
ExpandEnvironmentStrings(regkey, path, sizeof(path));
*dirname = apr_pstrdup(p, path);
- return APR_SUCCESS;
}
- return APR_ENOENT;
+ else
+ return APR_ENOENT;
}
+ for (fixch = *dirname; *fixch; ++fixch)
+ if (*fixch == '\\')
+ *fixch = '/';
}
APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,