1
0
Fork 0
forked from len0rd/rockbox

Make strnatcmp() and strnatcasecmp() call strcmp() or strcasecmp() if strings otherwise sort the same. This is done to make sure that strings always sort the same.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20265 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2009-03-09 22:04:40 +00:00
parent efe3ec86f1
commit babda88228

View file

@ -130,9 +130,12 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
} }
if (!ca && !cb) { if (!ca && !cb) {
/* The strings compare the same. Perhaps the caller /* The strings compare the same. Call str[case]cmp() to ensure
will want to call strcmp to break the tie. */ consistent results. */
return 0; if(fold_case)
return strcasecmp(a,b);
else
return strcmp(a,b);
} }
if (fold_case) { if (fold_case) {