aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 19:16:21 +0200
committerMax Kellermann <max@duempel.org>2008-10-09 19:16:21 +0200
commit9604f88fe772a0e69ff2790f9c9306bdc9f4f122 (patch)
tree4b41ddd10d712104ec60858874ea6d6556c4a751 /src/update.c
parent78899051c0fa1ab4adb8bc60df576c3a71992ecb (diff)
downloadmpd-9604f88fe772a0e69ff2790f9c9306bdc9f4f122.tar.gz
mpd-9604f88fe772a0e69ff2790f9c9306bdc9f4f122.tar.xz
mpd-9604f88fe772a0e69ff2790f9c9306bdc9f4f122.zip
update: make the "song" variable more local
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c5
1 files changed, 2 insertions, 3 deletions
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;