From 3a8f8e48fcbd6808379705b4749b76ab7518e3c9 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 4 Jun 2008 23:56:38 +0000 Subject: 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 --- crawl-ref/source/initfile.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crawl-ref') 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; -- cgit v1.2.3-54-g00ecf