diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-11 21:31:26 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-12 05:27:32 -0700 |
commit | 0fd45f50ec56bcfacae3f6f141ea804b9ac3493f (patch) | |
tree | 134c8b752246eb55315a3aab02419c188e362dea | |
parent | 8636b3185268e8de90c566d472c52b814111b8c3 (diff) | |
download | mpd-0fd45f50ec56bcfacae3f6f141ea804b9ac3493f.tar.gz mpd-0fd45f50ec56bcfacae3f6f141ea804b9ac3493f.tar.xz mpd-0fd45f50ec56bcfacae3f6f141ea804b9ac3493f.zip |
directory: rename isRootDirectory => path_is_music_root
down with camelCase!
-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; |