diff options
-rw-r--r-- | src/directory.c | 2 | ||||
-rw-r--r-- | src/directory.h | 6 | ||||
-rw-r--r-- | src/update.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/directory.c b/src/directory.c index 846f2510a..e66349e02 100644 --- a/src/directory.c +++ b/src/directory.c @@ -74,7 +74,7 @@ directory_get_subdir(struct directory *dir, const char *name) assert(name != NULL); - if (isRootDirectory(name)) + if (path_is_music_root(name)) return dir; duplicated = xstrdup(name); diff --git a/src/directory.h b/src/directory.h index 9c3063d75..bb2888034 100644 --- a/src/directory.h +++ b/src/directory.h @@ -45,10 +45,10 @@ struct directory { extern struct directory music_root; -static inline int isRootDirectory(const char *name) +static inline int path_is_music_root(const char *name) { - /* TODO: verify and remove !name check */ - return (!name || *name == '\0' || !strcmp(name, "/")); + assert(name); + return (!*name || !strcmp(name, "/")); } struct directory * directory_new(const char *dirname, struct directory *parent); diff --git a/src/update.c b/src/update.c index 7c2a7570a..72f4b943b 100644 --- a/src/update.c +++ b/src/update.c @@ -349,8 +349,8 @@ static void updatePath(const char *utf8path) static void * update_task(void *_path) { - if (_path != NULL && !isRootDirectory(_path)) { - updatePath((char *)_path); + if (_path && !path_is_music_root(_path)) { + updatePath(_path); free(_path); } else { struct stat st; |