diff options
author | Max Kellermann <max@duempel.org> | 2008-10-31 16:47:14 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-31 16:47:14 +0100 |
commit | d8e877e3355d0858c78a6d9a7060a6683024dd30 (patch) | |
tree | cdc996fa583c1f996da6ff18500b7cf360e182e1 /src/playlist.c | |
parent | ef542716196b90b71480ee952db64c3df736a12e (diff) | |
download | mpd-d8e877e3355d0858c78a6d9a7060a6683024dd30.tar.gz mpd-d8e877e3355d0858c78a6d9a7060a6683024dd30.tar.xz mpd-d8e877e3355d0858c78a6d9a7060a6683024dd30.zip |
path: moved playlist_dir to mapper.c
Added the function map_spl_utf8_to_fs() which replaces
utf8_to_fs_playlist_path().
Diffstat (limited to 'src/playlist.c')
-rw-r--r-- | src/playlist.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/playlist.c b/src/playlist.c index 58db673aa..61a0bb56b 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1190,15 +1190,16 @@ enum playlist_result savePlaylist(const char *utf8file) FILE *fp; struct stat sb; char path_max_tmp[MPD_PATH_MAX]; + const char *path; if (!is_valid_playlist_name(utf8file)) return PLAYLIST_RESULT_BAD_NAME; - utf8_to_fs_playlist_path(path_max_tmp, utf8file); - if (!stat(path_max_tmp, &sb)) + path = map_spl_utf8_to_fs(utf8file, path_max_tmp); + if (!stat(path, &sb)) return PLAYLIST_RESULT_LIST_EXISTS; - while (!(fp = fopen(path_max_tmp, "w")) && errno == EINTR); + while (!(fp = fopen(path, "w")) && errno == EINTR); if (fp == NULL) return PLAYLIST_RESULT_ERRNO; |