summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-12-19 13:09:36 (GMT)
committerBrad King <brad.king@kitware.com>2012-12-19 13:09:36 (GMT)
commite33fa5b67880e47fb350d5545a5ba04b8d6f3eb3 (patch)
tree1c08689b76eaf6228cd7fc946e12334350326f9e /Source/kwsys/SystemTools.cxx
parent5ac16ea6e4ddb086d48c97fa4f58543284ec3305 (diff)
parenta0f91f1daa7765066a784e4479da7e231374a065 (diff)
downloadCMake-e33fa5b67880e47fb350d5545a5ba04b8d6f3eb3.zip
CMake-e33fa5b67880e47fb350d5545a5ba04b8d6f3eb3.tar.gz
CMake-e33fa5b67880e47fb350d5545a5ba04b8d6f3eb3.tar.bz2
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 085d988..1054d65 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2754,9 +2754,15 @@ kwsys_stl::string SystemTools::GetRealPath(const char* path)
bool SystemTools::FileIsDirectory(const char* name)
{
+ size_t length = strlen(name);
+ if (length == 0)
+ {
+ return false;
+ }
+
// Remove any trailing slash from the name.
char buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
- size_t last = strlen(name)-1;
+ size_t last = length-1;
if(last > 0 && (name[last] == '/' || name[last] == '\\')
&& strcmp(name, "/") !=0)
{