diff options
author | Max Kellermann <max@duempel.org> | 2009-01-02 16:26:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-02 16:26:19 +0100 |
commit | cc4e0a786deb268a30798fb6e93a151a49ed4cea (patch) | |
tree | e918ca49479e4b4df0ef33b7d3454d4002753fe9 /src/directory.c | |
parent | 8cf913854179f19d55362b333d6a2d3a0b203155 (diff) | |
download | mpd-cc4e0a786deb268a30798fb6e93a151a49ed4cea.tar.gz mpd-cc4e0a786deb268a30798fb6e93a151a49ed4cea.tar.xz mpd-cc4e0a786deb268a30798fb6e93a151a49ed4cea.zip |
directory: use GLib instead of utils.h
Diffstat (limited to 'src/directory.c')
-rw-r--r-- | src/directory.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/directory.c b/src/directory.c index ccf2be7a4..8708e9095 100644 --- a/src/directory.c +++ b/src/directory.c @@ -18,12 +18,13 @@ #include "directory.h" #include "song.h" -#include "utils.h" #include "path.h" +#include <glib.h> + #include <assert.h> #include <string.h> -#include <glib.h> +#include <stdlib.h> struct directory * directory_new(const char *path, struct directory *parent) @@ -34,8 +35,8 @@ directory_new(const char *path, struct directory *parent) assert(path != NULL); assert((*path == 0) == (parent == NULL)); - directory = xcalloc(1, sizeof(*directory) - - sizeof(directory->path) + pathlen + 1); + directory = g_malloc0(sizeof(*directory) - + sizeof(directory->path) + pathlen + 1); directory->parent = parent; memcpy(directory->path, path, pathlen + 1); @@ -92,7 +93,7 @@ directory_get_directory(struct directory *directory, const char *name) if (isRootDirectory(name)) return directory; - duplicated = xstrdup(name); + duplicated = g_strdup(name); locate = strchr(duplicated, '/'); while (1) { if (locate) |