summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ffaad1)
raw | patch | inline | side by side (parent: 7ffaad1)
author | Max Kellermann <max@duempel.org> | |
Wed, 8 Jul 2009 19:38:33 +0000 (21:38 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 8 Jul 2009 19:38:33 +0000 (21:38 +0200) |
src/filelist.c | patch | blob | history |
diff --git a/src/filelist.c b/src/filelist.c
index 92e63792bee59f68fd5600e440c694b0cc6cfd8f..100db88b7458e004ff2164f1ce7c4307ee747956 100644 (file)
--- a/src/filelist.c
+++ b/src/filelist.c
#include "filelist.h"
#include "libmpdclient.h"
+#include <stdbool.h>
#include <string.h>
#include <assert.h>
filelist_compare_indirect, compare_func);
}
+static bool
+same_song(const struct mpd_song *a, const struct mpd_song *b)
+{
+ return strcmp(a->file, b->file) == 0;
+}
+
int
filelist_find_song(struct filelist *fl, const struct mpd_song *song)
{
if (entity && entity->type == MPD_INFO_ENTITY_TYPE_SONG) {
struct mpd_song *song2 = entity->info.song;
- if (strcmp(song->file, song2->file) == 0)
+ if (same_song(song, song2))
return i;
}
}