summaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-04-06 11:46:56 +0100
committerPeter Powell <petpow@saberuk.com>2013-04-06 11:47:56 +0100
commit2ae42bbb1fbd661f6078fdbeb65e1d430e38c805 (patch)
treeb4fa47fbfb51f4b9ced9e893e72ca11c493d9a58 /src/configparser.cpp
parentbc148f5227b6a4e6ac2d69587998836412d51193 (diff)
Default to the XML config format.
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index 7d9eab651..25b919b81 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -119,7 +119,7 @@ struct Parser
while (1)
{
ch = next();
- if (ch == '&' && (flags & FLAG_USE_XML))
+ if (ch == '&' && !(flags & FLAG_USE_COMPAT))
{
std::string varname;
while (1)
@@ -141,7 +141,7 @@ struct Parser
throw CoreException("Undefined XML entity reference '&" + varname + ";'");
value.append(var->second);
}
- else if (ch == '\\' && !(flags & FLAG_USE_XML))
+ else if (ch == '\\' && (flags & FLAG_USE_COMPAT))
{
int esc = next();
if (esc == 'n')
@@ -211,7 +211,7 @@ struct Parser
}
else if (name == "define")
{
- if (!(flags & FLAG_USE_XML))
+ if (flags & FLAG_USE_COMPAT)
throw CoreException("<define> tags may only be used in XML-style config (add <config format=\"xml\">)");
std::string varname = tag->getString("name");
std::string value = tag->getString("value");
@@ -223,9 +223,9 @@ struct Parser
{
std::string format = tag->getString("format");
if (format == "xml")
- flags |= FLAG_USE_XML;
+ flags &= ~FLAG_USE_COMPAT;
else if (format == "compat")
- flags &= ~FLAG_USE_XML;
+ flags |= FLAG_USE_COMPAT;
else if (!format.empty())
throw CoreException("Unknown configuration format " + format);
}