summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-01-10 16:56:59 +0000
committerPierre Ossman <ossman@cendio.se>2006-01-10 16:56:59 +0000
commit34e81ffb350540004b3aa9f5614f6b511ab96b37 (patch)
treecbcc4f2df6d66e180fd65ee50488545786d094f1
parent29118f50cb848076c89aee54829f4da6d7b8df77 (diff)
Handle Windows paths when normalizing authkey path.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@444 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--polyp/authkey.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/polyp/authkey.c b/polyp/authkey.c
index 35d97b7b..969f09d9 100644
--- a/polyp/authkey.c
+++ b/polyp/authkey.c
@@ -128,12 +128,20 @@ int pa_authkey_load(const char *path, void *data, size_t length) {
static const char *normalize_path(const char *fn, char *s, size_t l) {
assert(fn && s && l > 0);
+#ifndef OS_IS_WIN32
if (fn[0] != '/') {
+#else
+ if (strlen(fn) < 3 || !isalpha(fn[0]) || fn[1] != ':' || fn[2] != '\\') {
+#endif
char homedir[PATH_MAX];
if (!pa_get_home_dir(homedir, sizeof(homedir)))
return NULL;
+#ifndef OS_IS_WIN32
snprintf(s, l, "%s/%s", homedir, fn);
+#else
+ snprintf(s, l, "%s\\%s", homedir, fn);
+#endif
return s;
}