aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-29 17:42:54 +0100
committerMax Kellermann <max@duempel.org>2008-12-29 17:42:54 +0100
commit509d12ae8860648b3367f58152ef04d7a2800c2e (patch)
tree9b0766326f76d82b2992c8fa5b3a879a63efe770 /src/utils.c
parentd4638834f808afba46903abbdeab8fb9599b73d1 (diff)
downloadmpd-509d12ae8860648b3367f58152ef04d7a2800c2e.tar.gz
mpd-509d12ae8860648b3367f58152ef04d7a2800c2e.tar.xz
mpd-509d12ae8860648b3367f58152ef04d7a2800c2e.zip
utils: implement parsePath() with g_strdup() on WIN32
On WIN32, parsePath() now simply duplicates the input string. There is currently nothing special we can do here. The old code was not portable on WIN32.
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c
index 9bab473c5..9f00e687a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -21,12 +21,16 @@
#include "../config.h"
+#include <glib.h>
+
#include <assert.h>
#include <string.h>
#include <sys/types.h>
-#include <pwd.h>
#include <fcntl.h>
-#include <glib.h>
+
+#ifndef WIN32
+#include <pwd.h>
+#endif
#ifdef HAVE_IPV6
#include <sys/socket.h>
@@ -114,6 +118,7 @@ G_GNUC_MALLOC void *xcalloc(size_t nmemb, size_t size)
char *parsePath(char *path)
{
+#ifndef WIN32
if (path[0] != '/' && path[0] != '~') {
g_warning("\"%s\" is not an absolute path", path);
return NULL;
@@ -170,8 +175,11 @@ char *parsePath(char *path)
strcat(newPath, path + pos);
return newPath;
} else {
+#endif
return xstrdup(path);
+#ifndef WIN32
}
+#endif
}
int set_nonblocking(int fd)