From 313e8e3ecc15e65700e64252207227612d6d9195 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:08:16 +0200 Subject: directory: path must not be NULL For the root directory, let's set path to an empty string. This saves a few checks. --- src/database.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/database.c') diff --git a/src/database.c b/src/database.c index 98e50ad87..bd278a635 100644 --- a/src/database.c +++ b/src/database.c @@ -37,7 +37,7 @@ static time_t directory_dbModTime; void db_init(void) { - music_root = directory_new(NULL, NULL); + music_root = directory_new("", NULL); updateDirectory(music_root); stats.numberOfSongs = countSongsIn(NULL); stats.dbPlayTime = sumSongTimesIn(NULL); @@ -233,7 +233,7 @@ int db_load(void) struct stat st; if (!music_root) - music_root = directory_new(NULL, NULL); + music_root = directory_new("", NULL); while (!(fp = fopen(dbFile, "r")) && errno == EINTR) ; if (fp == NULL) { ERROR("unable to open db file \"%s\": %s\n", -- cgit v1.2.3