update: make the "song" variable more local

This commit is contained in:
Max Kellermann 2008-10-09 19:16:21 +02:00
parent 78899051c0
commit 9604f88fe7

View File

@ -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;