Merge branch 'update-kwsys' into release

This commit is contained in:
Brad King 2016-10-08 05:28:15 -04:00
commit 9f240cff8a
1 changed files with 8 additions and 10 deletions

View File

@ -2716,17 +2716,15 @@ unsigned long SystemTools::FileLength(const std::string& filename)
return length; return length;
} }
int SystemTools::Strucmp(const char *s1, const char *s2) int SystemTools::Strucmp(const char* l, const char* r)
{ {
// lifted from Graphvis http://www.graphviz.org int lc;
while ((*s1 != '\0') int rc;
&& (tolower(*s1) == tolower(*s2))) do {
{ lc = tolower(*l++);
s1++; rc = tolower(*r++);
s2++; } while(lc == rc && lc);
} return lc - rc;
return tolower(*s1) - tolower(*s2);
} }
// return file's modified time // return file's modified time