diff options
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 33d3e64..61cca36 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2293,7 +2293,8 @@ bool SystemTools::FileIsDirectory(const char* name) // Remove any trailing slash from the name. char buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; int last = static_cast<int>(strlen(name))-1; - if(last >= 0 && (name[last] == '/' || name[last] == '\\')) + if(last > 0 && (name[last] == '/' || name[last] == '\\') + && strcmp(name, "/") !=0) { memcpy(buffer, name, last); buffer[last] = 0; |