From 460535315751ea2239a98f1817ee0c1c11720e81 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 30 Dec 2007 08:47:22 +0000 Subject: Fixed bad handling of w: tags in .des files (yellow:5 => fail) (David). Fixed summoned monsters dropping their gear when killed (needs some adjustment). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3147 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/libutil.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/libutil.cc') diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 25e705a0ec..8b5bb7bbac 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -235,7 +235,10 @@ bool strip_tag(std::string &s, const std::string &tag, bool skip_padding) std::string strip_tag_prefix(std::string &s, const std::string &tagprefix) { - const std::string::size_type pos = s.find(tagprefix); + std::string::size_type pos = s.find(tagprefix); + while (pos && pos != std::string::npos && !isspace(s[pos - 1])) + pos = s.find(tagprefix, pos + 1); + if (pos == std::string::npos) return (""); -- cgit v1.2.3-54-g00ecf