update: apply .mpdignore matches to subdirectories

Wildcard matches are directly applied to all filenames in
subdirectories without any attempt at matching relative paths.

This change is based on the following feature request:

  http://bugs.musicpd.org/view.php?id=3729
This commit is contained in:
Anthony DeRossi
2015-09-29 10:39:07 -07:00
committed by Max Kellermann
parent de332a16d1
commit 6b6c7b0920
6 changed files with 38 additions and 11 deletions

View File

@@ -36,15 +36,23 @@
class Path;
class ExcludeList {
const ExcludeList *const parent;
#ifdef HAVE_CLASS_GLOB
std::forward_list<Glob> patterns;
#endif
public:
ExcludeList()
:parent(nullptr) {}
ExcludeList(const ExcludeList &_parent)
:parent(&_parent) {}
gcc_pure
bool IsEmpty() const {
#ifdef HAVE_CLASS_GLOB
return patterns.empty();
return ((parent == nullptr) || parent->IsEmpty()) && patterns.empty();
#else
/* not implemented */
return true;