aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/directory.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/directory.c b/src/directory.c
index 0fa5e85f6..5ac94c534 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -1189,17 +1189,15 @@ int printSongInDirectory(FILE * fp, Song * song, void * data) {
}
static inline int strstrSearchTag(Song * song, int type, char * str) {
- MpdTagItem * item;
+ int i;
char * dup;
if(!song->tag) return 0;
- for(item = song->tag->tagItems; item && item->type!=TAG_ITEM_END;
- item++)
- {
- if(item->type != type) continue;
+ for(i = 0; i < song->tag->numOfItems; i++) {
+ if(song->tag->items[i].type != type) continue;
- dup = strDupToUpper(item->value);
+ dup = strDupToUpper(song->tag->items[i].value);
if(strstr(dup, str)) return 1;
free(dup);
}
@@ -1263,16 +1261,14 @@ int searchForSongsIn(FILE * fp, char * name, char * item, char * string) {
}
static inline int tagItemFoundAndMatches(Song * song, int type, char * str) {
- MpdTagItem * item;
+ int i;
if(!song->tag) return 0;
- for(item = song->tag->tagItems; item && item->type != TAG_ITEM_END;
- item++)
- {
- if(item->type != type) continue;
+ for(i = 0; i < song->tag->numOfItems; i++) {
+ if(song->tag->items[i].type != type) continue;
- if( 0 == strcmp(str, item->value)) return 1;
+ if(0 == strcmp(str, song->tag->items[i].value)) return 1;
}
return 0;