From d8e877e3355d0858c78a6d9a7060a6683024dd30 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 31 Oct 2008 16:47:14 +0100 Subject: path: moved playlist_dir to mapper.c Added the function map_spl_utf8_to_fs() which replaces utf8_to_fs_playlist_path(). --- src/path.c | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src/path.c') diff --git a/src/path.c b/src/path.c index 0494a0985..62a2362b5 100644 --- a/src/path.c +++ b/src/path.c @@ -32,8 +32,6 @@ #include -static const char *playlistDir; -static size_t playlist_dir_len; static char *fsCharset; char *fs_charset_to_utf8(char *dst, const char *str) @@ -99,22 +97,10 @@ const char *getFsCharset(void) void initPaths(void) { - ConfigParam *playlistParam = parseConfigFilePath(CONF_PLAYLIST_DIR, 1); ConfigParam *fsCharsetParam = getConfigParam(CONF_FS_CHARSET); char *charset = NULL; char *originalLocale; - DIR *dir; - - playlistDir = xstrdup(playlistParam->value); - playlist_dir_len = strlen(playlistDir); - - if ((dir = opendir(playlistDir)) == NULL) { - ERROR("cannot open %s \"%s\" (config line %i): %s\n", - CONF_PLAYLIST_DIR, playlistParam->value, - playlistParam->line, strerror(errno)); - } else - closedir(dir); if (fsCharsetParam) { charset = xstrdup(fsCharsetParam->value); @@ -183,13 +169,6 @@ char *pfx_dir(char *dst, return (dst + pfx_len + 1); } -char *rpp2app_r(char *dst, const char *rel_path) -{ - pfx_dir(dst, rel_path, strlen(rel_path), - (const char *)playlistDir, playlist_dir_len); - return dst; -} - char *sanitizePathDup(const char *path) { int len = strlen(path) + 1; @@ -229,10 +208,3 @@ char *sanitizePathDup(const char *path) return xrealloc(ret, len + 1); } - -void utf8_to_fs_playlist_path(char *path_max_tmp, const char *utf8path) -{ - utf8_to_fs_charset(path_max_tmp, utf8path); - rpp2app_r(path_max_tmp, path_max_tmp); - strncat(path_max_tmp, "." PLAYLIST_FILE_SUFFIX, MPD_PATH_MAX - 1); -} -- cgit v1.2.3