aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ls.c16
-rw-r--r--src/ls.h2
-rw-r--r--src/playlist.c7
3 files changed, 3 insertions, 22 deletions
diff --git a/src/ls.c b/src/ls.c
index de42e3f8c..01614710f 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -228,22 +228,6 @@ const char *getSuffix(const char *utf8file)
return ret;
}
-static int hasSuffix(const char *utf8file, const char *suffix)
-{
- const char *s = getSuffix(utf8file);
- if (s && 0 == strcmp(s, suffix))
- return 1;
- return 0;
-}
-
-int isPlaylist(const char *utf8file)
-{
- if (isFile(utf8file, NULL)) {
- return hasSuffix(utf8file, PLAYLIST_FILE_SUFFIX);
- }
- return 0;
-}
-
int isDir(const char *utf8name)
{
struct stat st;
diff --git a/src/ls.h b/src/ls.h
index f2a2c510b..fdc61bd81 100644
--- a/src/ls.h
+++ b/src/ls.h
@@ -38,8 +38,6 @@ int myStat(const char *utf8file, struct stat *st);
int isDir(const char *utf8name);
-int isPlaylist(const char *utf8file);
-
struct decoder_plugin *hasMusicSuffix(const char *utf8file, unsigned int next);
struct decoder_plugin *isMusic(const char *utf8file, time_t * mtime,
diff --git a/src/playlist.c b/src/playlist.c
index 840c9c6b5..34a2311aa 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1185,11 +1185,10 @@ enum playlist_result deletePlaylist(const char *utf8file)
utf8_to_fs_playlist_path(path_max_tmp, utf8file);
- if (!isPlaylist(path_max_tmp))
- return PLAYLIST_RESULT_NO_SUCH_LIST;
-
if (unlink(path_max_tmp) < 0)
- return PLAYLIST_RESULT_ERRNO;
+ return errno == ENOENT
+ ? PLAYLIST_RESULT_NO_SUCH_LIST
+ : PLAYLIST_RESULT_ERRNO;
return PLAYLIST_RESULT_SUCCESS;
}