[cmake-commits] king committed SystemTools.cxx 1.220 1.221
cmake-commits at cmake.org
cmake-commits at cmake.org
Sun Jan 20 19:29:14 EST 2008
Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv343/Source/kwsys
Modified Files:
SystemTools.cxx
Log Message:
BUG: Fix previous commit to not access empty strings out of bounds.
Index: SystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemTools.cxx,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -d -r1.220 -r1.221
--- SystemTools.cxx 20 Jan 2008 22:24:46 -0000 1.220
+++ SystemTools.cxx 21 Jan 2008 00:29:12 -0000 1.221
@@ -2117,7 +2117,7 @@
i != path.end(); ++i)
{
kwsys_stl::string& p = *i;
- if(p[p.size()-1] != '/')
+ if(p.empty() || p[p.size()-1] != '/')
{
p += "/";
}
@@ -2249,7 +2249,7 @@
i != path.end(); ++i)
{
kwsys_stl::string& p = *i;
- if(p[p.size()-1] != '/')
+ if(p.empty() || p[p.size()-1] != '/')
{
p += "/";
}
@@ -2341,7 +2341,7 @@
i != path.end(); ++i)
{
kwsys_stl::string& p = *i;
- if(p[p.size()-1] != '/')
+ if(p.empty() || p[p.size()-1] != '/')
{
p += "/";
}
More information about the Cmake-commits
mailing list