XPath: translate() function fixed
git-svn-id: http://pugixml.googlecode.com/svn/trunk@137 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
7209359dfe
commit
78eddacef5
@ -2249,10 +2249,12 @@ namespace pugi
|
|||||||
{
|
{
|
||||||
std::string::size_type pos = from.find(*it);
|
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);
|
it = s.erase(it);
|
||||||
else if (pos != std::string::npos)
|
else
|
||||||
*it = to[pos];
|
*it++ = to[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user