summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-30 08:47:22 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-30 08:47:22 +0000
commit460535315751ea2239a98f1817ee0c1c11720e81 (patch)
treeb01ee7da64211bc76cdcf92cb9a6b15d0c547225 /crawl-ref/source/libutil.cc
parentf1f838b18f17f470004d798383c3acb985a4b10d (diff)
downloadcrawl-ref-460535315751ea2239a98f1817ee0c1c11720e81.tar.gz
crawl-ref-460535315751ea2239a98f1817ee0c1c11720e81.zip
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
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc5
1 files changed, 4 insertions, 1 deletions
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 ("");