diff options
author | Max Kellermann <max@duempel.org> | 2008-10-09 19:11:49 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:50 -0700 |
commit | e553fa4d36016cd4ba2162a64d8a770bef618608 (patch) | |
tree | 9d357b248192f9d0ae15e71139bdf43d0f21dbaa | |
parent | 08ac9c4b05d51f79733b6ad27b7a79240c92fb03 (diff) | |
download | mpd-e553fa4d36016cd4ba2162a64d8a770bef618608.tar.gz mpd-e553fa4d36016cd4ba2162a64d8a770bef618608.tar.xz mpd-e553fa4d36016cd4ba2162a64d8a770bef618608.zip |
update: never pass root path to updatePath()
update_task() already checks if it has got a root path. Extend this
check and in turn remove a check in the inner function updatePath().
-rw-r--r-- | src/update.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/update.c b/src/update.c index c2f611e9e..e2afb7f81 100644 --- a/src/update.c +++ b/src/update.c @@ -378,11 +378,6 @@ static enum update_return updatePath(const char *utf8path) directory_sort(directory); return ret; } - /* we don't want to delete the root directory */ - else if (directory == db_get_root()) { - clear_directory(directory); - return UPDATE_RETURN_NOUPDATE; - } /* if updateDirectory fails, means we should delete it */ else { LOG("removing directory: %s\n", utf8path); @@ -442,7 +437,7 @@ static void * update_task(void *_path) { enum update_return ret = UPDATE_RETURN_NOUPDATE; - if (_path) { + if (_path != NULL && !isRootDirectory(_path)) { ret = updatePath((char *)_path); free(_path); } else { |