summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-04 23:56:38 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-04 23:56:38 +0000
commit3a8f8e48fcbd6808379705b4749b76ab7518e3c9 (patch)
tree33e81ba1f1eebb6e507c643bb8c5a6d741174e86 /crawl-ref/source/initfile.cc
parent380661f014abdc14c12dc5a9bf10a73be822821c (diff)
downloadcrawl-ref-3a8f8e48fcbd6808379705b4749b76ab7518e3c9.tar.gz
crawl-ref-3a8f8e48fcbd6808379705b4749b76ab7518e3c9.zip
Fixed crashes that were caused by init file variables (option value
aliases). Also, variable names can now include '-'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5478 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 45c0c45df3..1b6b0025ff 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -1535,7 +1535,7 @@ std::string game_options::unalias(const std::string &key) const
return (i == aliases.end()? key : i->second);
}
-#define IS_VAR_CHAR(c) (isalpha(c) || c == '_')
+#define IS_VAR_CHAR(c) (isalpha(c) || c == '_' || c == '-')
std::string game_options::expand_vars(const std::string &field) const
{
@@ -1571,7 +1571,7 @@ std::string game_options::expand_vars(const std::string &field) const
string_map::const_iterator x = variables.find(var_name);
- if (x == aliases.end())
+ if (x == variables.end())
{
curr_pos = end_pos + 1;
continue;