diff options
author | Brad King <brad.king@kitware.com> | 2012-12-19 13:09:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-12-19 13:09:36 (GMT) |
commit | e33fa5b67880e47fb350d5545a5ba04b8d6f3eb3 (patch) | |
tree | 1c08689b76eaf6228cd7fc946e12334350326f9e /Source/kwsys/SystemTools.cxx | |
parent | 5ac16ea6e4ddb086d48c97fa4f58543284ec3305 (diff) | |
parent | a0f91f1daa7765066a784e4479da7e231374a065 (diff) | |
download | CMake-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.cxx | 8 |
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) { |