diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/configparser.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 0102c910c..6fdc56c32 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -205,7 +205,7 @@ struct Parser while (1) { ch = next(); - if (isalnum(ch) || (varname.empty() && ch == '#')) + if (isalnum(ch) || (varname.empty() && ch == '#') || ch == '.') varname.push_back(ch); else if (ch == ';') break; @@ -233,6 +233,13 @@ struct Parser throw CoreException("Invalid numeric character reference '&" + varname + ";'"); value.push_back(static_cast<char>(lvalue)); } + else if (varname.compare(0, 4, "env.") == 0) + { + const char* envstr = getenv(varname.c_str() + 4); + if (!envstr) + throw CoreException("Undefined XML environment entity reference '&" + varname + ";'"); + value.append(envstr); + } else { insp::flat_map<std::string, std::string>::iterator var = stack.vars.find(varname); |