XPath: translate() function fixed

git-svn-id: http://pugixml.googlecode.com/svn/trunk@137 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2009-10-10 10:12:43 +00:00
parent 7209359dfe
commit 78eddacef5

View file

@ -2249,10 +2249,12 @@ namespace pugi
{
std::string::size_type pos = from.find(*it);
if (pos != std::string::npos && pos >= to.length())
if (pos == std::string::npos)
++it;
else if (pos >= to.length())
it = s.erase(it);
else if (pos != std::string::npos)
*it = to[pos];
else
*it++ = to[pos];
}
return s;