From 78eddacef534e450735598dc960a25c41baf4e36 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sat, 10 Oct 2009 10:12:43 +0000 Subject: XPath: translate() function fixed git-svn-id: http://pugixml.googlecode.com/svn/trunk@137 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pugixpath.cpp') 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; -- cgit v1.2.3