aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-02 05:36:32 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-02 05:36:40 +0100
commitc6191d90ca1a19440d79ddc5fa6f4a035f6bb231 (patch)
tree8496d4ecb41f087a8f227af0d136ad2350c5f63e
parent3e99625f2582f5bb6275f422989f8a7cf9611257 (diff)
downloadpaludis-c6191d90ca1a19440d79ddc5fa6f4a035f6bb231.tar.gz
paludis-c6191d90ca1a19440d79ddc5fa6f4a035f6bb231.tar.xz
Fix backwards inline comment logic
-rw-r--r--paludis/util/config_file.cc2
-rw-r--r--paludis/util/config_file_TEST.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc
index a51517e..c3e77eb 100644
--- a/paludis/util/config_file.cc
+++ b/paludis/util/config_file.cc
@@ -449,7 +449,7 @@ namespace
else
need_single_space_unless_eol = true;
}
- else if ((! k.options()[kvcfo_allow_inline_comments]) && parser.consume(simple_parser::exact("#")))
+ else if ((k.options()[kvcfo_allow_inline_comments]) && parser.consume(simple_parser::exact("#")))
{
if (! parser.consume(*simple_parser::any_except("\n")))
throw InternalError(PALUDIS_HERE, "failed to consume a zero width match");
diff --git a/paludis/util/config_file_TEST.cc b/paludis/util/config_file_TEST.cc
index 1bdfc18..acbaac2 100644
--- a/paludis/util/config_file_TEST.cc
+++ b/paludis/util/config_file_TEST.cc
@@ -443,7 +443,7 @@ namespace test_cases
d_s << "three # bar" << std::endl;
d_s << "four = four # foo" << std::endl;
d_s << "five = five # moo" << std::endl;
- KeyValueConfigFile ff(d_s, KeyValueConfigFileOptions(),
+ KeyValueConfigFile ff(d_s, KeyValueConfigFileOptions() + kvcfo_allow_inline_comments,
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
TEST_CHECK_EQUAL(std::distance(ff.begin(), ff.end()), 5);