aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-26 11:19:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-26 11:19:37 +0000
commit575fb3bc3a760799efbea3fab4d41f361299fe5f (patch)
tree8547bdd2c218c917818581276b2b3decaddfb652
parentcee3c8f4e93883d656298f6653c049a6eb4da2e0 (diff)
downloadpaludis-575fb3bc3a760799efbea3fab4d41f361299fe5f.tar.gz
paludis-575fb3bc3a760799efbea3fab4d41f361299fe5f.tar.xz
Handle || ( ) in LICENSE properly, even when the group is empty
-rw-r--r--paludis/environment.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/paludis/environment.cc b/paludis/environment.cc
index cf59b58..ba57800 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -22,6 +22,7 @@
#include <paludis/dep_parser.hh>
#include <paludis/environment.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/save.hh>
/** \file
* Implementation of Environment.
@@ -75,7 +76,22 @@ namespace
void visit(const AnyDepAtom * atom)
{
- std::for_each(atom->begin(), atom->end(), accept_visitor(this));
+ bool local_ok(false);
+
+ if (atom->begin() == atom->end())
+ local_ok = true;
+ else
+ {
+ for (CompositeDepAtom::Iterator i(atom->begin()), i_end(atom->end()) ;
+ i != i_end ; ++i)
+ {
+ Save<bool> save_ok(&ok, true);
+ (*i)->accept(this);
+ local_ok |= ok;
+ }
+ }
+
+ ok &= local_ok;
}
void visit(const UseDepAtom * atom)