diff options
author | Max Kellermann <max@duempel.org> | 2009-01-04 19:37:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-04 19:37:19 +0100 |
commit | da693822730d1712d44da85389e4d8b659b3b5df (patch) | |
tree | c6af7f8c5eab082cbdab029066b8f8758906d6b3 /src/stored_playlist.c | |
parent | 1a04e571686ea9c9bfca2701564a41f7d9d12a9e (diff) |
path: removed pfx_dir()
Use GLib's g_build_filename() instead of pfx_dir().
Diffstat (limited to 'src/stored_playlist.c')
-rw-r--r-- | src/stored_playlist.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/stored_playlist.c b/src/stored_playlist.c index 3504c0a26..a503c2841 100644 --- a/src/stored_playlist.c +++ b/src/stored_playlist.c @@ -37,13 +37,12 @@ static struct stored_playlist_info * load_playlist_info(const char *parent_path_fs, const char *name_fs) { size_t name_length = strlen(name_fs); - char buffer[MPD_PATH_MAX], *name, *name_utf8; + char buffer[MPD_PATH_MAX], *path_fs, *name, *name_utf8; int ret; struct stat st; struct stored_playlist_info *playlist; if (name_length < 1 + sizeof(PLAYLIST_FILE_SUFFIX) || - strlen(parent_path_fs) + name_length >= sizeof(buffer) || memchr(name_fs, '\n', name_length) != NULL) return NULL; @@ -53,10 +52,9 @@ load_playlist_info(const char *parent_path_fs, const char *name_fs) sizeof(PLAYLIST_FILE_SUFFIX) - 1) != 0) return NULL; - pfx_dir(buffer, name_fs, name_length, - parent_path_fs, strlen(parent_path_fs)); - - ret = stat(buffer, &st); + path_fs = g_build_filename(parent_path_fs, name_fs, NULL); + ret = stat(path_fs, &st); + g_free(path_fs); if (ret < 0 || !S_ISREG(st.st_mode)) return NULL; |