dbertoni 2003/03/27 18:01:44
Modified: c/src/PlatformSupport XalanParsedURI.cpp
Log:
Fixes for wrap-around and reading past the end of the string.
Revision Changes Path
1.3 +4 -3 xml-xalan/c/src/PlatformSupport/XalanParsedURI.cpp
Index: XalanParsedURI.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanParsedURI.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XalanParsedURI.cpp 24 Mar 2003 16:55:23 -0000 1.2
+++ XalanParsedURI.cpp 28 Mar 2003 02:01:44 -0000 1.3
@@ -278,15 +278,16 @@
// a) strip off characters after the right most
slash in the base path
XalanDOMString::size_type pathEnd =
base.m_path.length();
- while (pathEnd >= 0 && base.m_path[pathEnd] !=
XalanUnicode::charSolidus)
+ while (pathEnd > 0 && base.m_path[pathEnd - 1]
!= XalanUnicode::charSolidus)
{
--pathEnd;
}
- if (pathEnd >= 0)
+ if (pathEnd > 0)
{
// b) append relative path
- m_path = base.m_path.substr(0, pathEnd
+ 1) + m_path;
+ // This inserts the path portion from
base...
+ m_path.insert(0, base.m_path, 0,
pathEnd);
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]