Merge branch 'upstream-kwsys' into update-kwsys

This commit is contained in:
Brad King 2013-04-26 16:08:35 -04:00
commit 0c04428d04
1 changed files with 2 additions and 2 deletions

View File

@ -2741,11 +2741,11 @@ bool SystemTools::FileIsDirectory(const char* name)
return false; return false;
} }
// Remove any trailing slash from the name. // Remove any trailing slash from the name except in a root component.
char buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; char buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
size_t last = length-1; size_t last = length-1;
if(last > 0 && (name[last] == '/' || name[last] == '\\') if(last > 0 && (name[last] == '/' || name[last] == '\\')
&& strcmp(name, "/") !=0) && strcmp(name, "/") !=0 && name[last-1] != ':')
{ {
memcpy(buffer, name, last); memcpy(buffer, name, last);
buffer[last] = 0; buffer[last] = 0;