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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user