directory: path must not be NULL

For the root directory, let's set path to an empty string.  This saves
a few checks.
This commit is contained in:
Max Kellermann
2008-10-08 11:08:16 +02:00
parent 3b6efa99da
commit 0bfe7802d2
3 changed files with 9 additions and 11 deletions

View File

@@ -39,7 +39,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);
@@ -240,7 +240,7 @@ 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",