From 9604f88fe772a0e69ff2790f9c9306bdc9f4f122 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Oct 2008 19:16:21 +0200 Subject: update: make the "song" variable more local --- src/update.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/update.c b/src/update.c index 3a9dff87e..a1c0a2f25 100644 --- a/src/update.c +++ b/src/update.c @@ -250,12 +250,11 @@ static enum update_return updateInDirectory(struct directory *directory, const char *name, const struct stat *st) { - struct song *song; - if (S_ISREG(st->st_mode) && hasMusicSuffix(name, 0)) { const char *shortname = mpd_basename(name); + struct song *song = songvec_find(&directory->songs, shortname); - if (!(song = songvec_find(&directory->songs, shortname))) { + if (song == NULL) { song = song_file_load(shortname, directory); if (song == NULL) return -1; -- cgit v1.2.3