KWSys 2016-10-07 (dfe9b386)
Code extracted from: http://public.kitware.com/KWSys.git at commit dfe9b38635d80cb5253187c1ddf90923e1b9effd (master). Upstream Shortlog ----------------- Brad King (1): dfe9b386 SystemTools: Re-implement Strucmp
This commit is contained in:
parent
0ab471adf1
commit
bf28a3873d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue