unsigned char if you want to preserve its ordering! Fixes a bug
whereby an 0xFF character in a filename could trigger an assertion
failure (since du.c would sort the directory contents correctly but
trie.c would then expect it to be sorted wrong).
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8595
cda61777-01e9-0310-a592-
d414129be87e
*/
static int trieccmp(unsigned char a, unsigned char b)
{
*/
static int trieccmp(unsigned char a, unsigned char b)
{
- a = (a == '\0' ? '\0' : a == pathsep ? '\1' : a+1);
- b = (b == '\0' ? '\0' : b == pathsep ? '\1' : b+1);
- return (int)a - (int)b;
+ int ia = (a == '\0' ? '\0' : a == pathsep ? '\1' : a+1);
+ int ib = (b == '\0' ? '\0' : b == pathsep ? '\1' : b+1);
+ return ia - ib;
}
static int triencmp(const char *a, size_t alen,
}
static int triencmp(const char *a, size_t alen,