diff options
author | Max Kellermann <max@duempel.org> | 2012-08-13 23:37:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-14 02:28:04 +0200 |
commit | 1ae89728593fce4a40882fa133b9db269015da8f (patch) | |
tree | b4842a26396a6e40e75d233dfdd9abc31b54bccf /src/mapper.h | |
parent | adcd2c8eacd74aeb072b806a3c36922ca2ad753d (diff) | |
download | mpd-1ae89728593fce4a40882fa133b9db269015da8f.tar.gz mpd-1ae89728593fce4a40882fa133b9db269015da8f.tar.xz mpd-1ae89728593fce4a40882fa133b9db269015da8f.zip |
mapper: fix non-UTF8 music directory name
Duplicate the music_dir variable: one encoded in UTF-8, and another
one using the configured filesystem character set. This fixes an
ancient MPD bug.
Diffstat (limited to 'src/mapper.h')
-rw-r--r-- | src/mapper.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mapper.h b/src/mapper.h index ed4a60b56..d6184a175 100644 --- a/src/mapper.h +++ b/src/mapper.h @@ -36,9 +36,20 @@ void mapper_init(const char *_music_dir, const char *_playlist_dir); void mapper_finish(void); +/** + * Return the absolute path of the music directory encoded in UTF-8. + */ +G_GNUC_CONST +const char * +mapper_get_music_directory_utf8(void); + +/** + * Return the absolute path of the music directory encoded in the + * filesystem character set. + */ G_GNUC_CONST const char * -mapper_get_music_directory(void); +mapper_get_music_directory_fs(void); /** * Returns true if a music directory was configured. @@ -47,7 +58,7 @@ G_GNUC_CONST static inline bool mapper_has_music_directory(void) { - return mapper_get_music_directory() != NULL; + return mapper_get_music_directory_utf8() != NULL; } /** |