diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2009-10-10 10:12:43 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2009-10-10 10:12:43 +0000 |
commit | 78eddacef534e450735598dc960a25c41baf4e36 (patch) | |
tree | c1a93ee9fe7e1e4900ea8db02db4d07582a9c230 | |
parent | 7209359dfea1bbd051f5da7634945b654a28906c (diff) |
XPath: translate() function fixed
git-svn-id: http://pugixml.googlecode.com/svn/trunk@137 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r-- | src/pugixpath.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index 6e9cbbe..e262d68 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -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;
|