From 0c46207db41840ac70af7a5261969e865b748f1d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:55:52 +0200 Subject: directory: fix update in root directory Commit 0bfe7802 broke update for new files in the root directory, because music_root->path was an empty string and not NULL. There were some NULL tests missing. Change them to !isRootDirectory(path) instead of path!=NULL. --- src/dbUtils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/dbUtils.c') diff --git a/src/dbUtils.c b/src/dbUtils.c index aa7e639b7..9e307efc6 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -57,9 +57,8 @@ static int countSongsInDirectory(struct directory *directory, void *data) static int printDirectoryInDirectory(struct directory *directory, void *data) { int fd = (int)(size_t)data; - if (directory->path) { + if (!isRootDirectory(directory->path)) fdprintf(fd, "directory: %s\n", directory_get_path(directory)); - } return 0; } @@ -340,7 +339,7 @@ static int sumSavedFilenameMemoryInDirectory(struct directory *dir, void *data) { int *sum = data; - if (!dir->path) + if (!isRootDirectory(dir->path)) return 0; *sum += (strlen(directory_get_path(dir)) + 1 -- cgit v1.2.3