dbertoni 00/05/29 15:23:39
Modified: c/src/PlatformSupport URISupport.cpp
Log:
Fixed a bug where an empty context string would cause a crash.
Revision Changes Path
1.2 +2 -2 xml-xalan/c/src/PlatformSupport/URISupport.cpp
Index: URISupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/URISupport.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URISupport.cpp 2000/05/12 18:18:16 1.1
+++ URISupport.cpp 2000/05/29 22:23:39 1.2
@@ -147,7 +147,7 @@
const unsigned int theContextLength = length(context);
- const unsigned int indexOfSlash = lastIndexOf(context, '/');
+ const unsigned int indexOfSlash = theContextLength == 0 ? 0 :
lastIndexOf(context, '/');
if (indexOfSlash < theContextLength)
{
@@ -225,7 +225,7 @@
// OK, look for a quick, cheap exit...
const unsigned int len = length(uriString);
- const unsigned int index = indexOf(uriString, '\\');
+ unsigned int index = indexOf(uriString, '\\');
if (index != len)
{