aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-01 13:28:52 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-01 13:28:52 +0000
commit444a74810e47c25db514380e1e34dd0307704232 (patch)
tree09cf5bc41f378e9add77988dca168e3c048e72ac
parentf8687b299fb34696a1523e1e13f3e0619a4bd40c (diff)
downloadpaludis-444a74810e47c25db514380e1e34dd0307704232.tar.gz
paludis-444a74810e47c25db514380e1e34dd0307704232.tar.xz
Yet another USE_EXPAND fix
-rw-r--r--paludis/environment/default/default_environment.cc17
-rw-r--r--paludis/environment/default/default_environment_TEST.cc4
2 files changed, 12 insertions, 9 deletions
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index 938afa7..c3c5dd6 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -172,13 +172,16 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
}
}
- if (consider_minus_star)
- for (DefaultConfig::UseMinusStarIterator
- i(DefaultConfig::get_instance()->begin_use_prefixes_with_minus_star()),
- i_end(DefaultConfig::get_instance()->end_use_prefixes_with_minus_star()) ;
- i != i_end ; ++i)
- if (0 == i->compare(0, i->length(), stringify(f), 0, i->length()))
- return false;
+ for (DefaultConfig::UseMinusStarIterator
+ i(DefaultConfig::get_instance()->begin_use_prefixes_with_minus_star()),
+ i_end(DefaultConfig::get_instance()->end_use_prefixes_with_minus_star()) ;
+ i != i_end ; ++i)
+ {
+ if ((! consider_minus_star) && i->empty())
+ continue;
+ if (0 == i->compare(0, i->length(), stringify(f), 0, i->length()))
+ return false;
+ }
/* check use: package database config */
if (repo && repo->use_interface)
diff --git a/paludis/environment/default/default_environment_TEST.cc b/paludis/environment/default/default_environment_TEST.cc
index 0a7aa82..fcad357 100644
--- a/paludis/environment/default/default_environment_TEST.cc
+++ b/paludis/environment/default/default_environment_TEST.cc
@@ -85,7 +85,7 @@ namespace test_cases
TEST_CHECK(env->query_use(UseFlagName("more_exp_one"), &pde));
TEST_CHECK(env->query_use(UseFlagName("exp_two"), &pde));
- TEST_CHECK(env->query_use(UseFlagName("exp_one"), &pde));
+ TEST_CHECK(! env->query_use(UseFlagName("exp_one"), &pde));
TEST_CHECK(env->query_use(UseFlagName("third_exp_one"), &pde));
TEST_CHECK(! env->query_use(UseFlagName("third_exp_two"), &pde));
@@ -118,7 +118,7 @@ namespace test_cases
TEST_CHECK(env->query_use(UseFlagName("more_exp_one"), &pde));
TEST_CHECK(env->query_use(UseFlagName("exp_two"), &pde));
- TEST_CHECK(env->query_use(UseFlagName("exp_one"), &pde));
+ TEST_CHECK(! env->query_use(UseFlagName("exp_one"), &pde));
TEST_CHECK(env->query_use(UseFlagName("third_exp_one"), &pde));
TEST_CHECK(! env->query_use(UseFlagName("third_exp_two"), &pde));