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
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue