summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-28 16:55:09 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-28 16:55:09 +0000
commitc7283223183d8208092f1e85d48dd9efe28c1ac9 (patch)
tree050d21499408077c3b764c969393dced5f0a72fe /crawl-ref/source/mapdef.cc
parent936534f7197117b08938f4b96e0276e8f4f5314e (diff)
downloadcrawl-ref-c7283223183d8208092f1e85d48dd9efe28c1ac9.tar.gz
crawl-ref-c7283223183d8208092f1e85d48dd9efe28c1ac9.zip
Croak if SUBST: argument is malformed.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1682 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r--crawl-ref/source/mapdef.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index dc3e9bf384..a8044f1952 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -112,8 +112,13 @@ static std::string split_key_item(const std::string &s,
std::string substitute = trimmed_string(s.substr(sep + 1));
if (what_to_subst.length() != 1)
- return make_stringf("selector '%s' must be exactly one character",
- what_to_subst.c_str());
+ return make_stringf(
+ "selector '%s' must be exactly one character in '%s'",
+ what_to_subst.c_str(), s.c_str());
+
+ if (substitute.empty())
+ return make_stringf("no substitute defined in '%s'",
+ s.c_str());
*key = what_to_subst[0];
*arg = substitute;