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:
parent
efe3ec86f1
commit
babda88228
1 changed files with 6 additions and 3 deletions
|
|
@ -130,9 +130,12 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
|
|||
}
|
||||
|
||||
if (!ca && !cb) {
|
||||
/* The strings compare the same. Perhaps the caller
|
||||
will want to call strcmp to break the tie. */
|
||||
return 0;
|
||||
/* The strings compare the same. Call str[case]cmp() to ensure
|
||||
consistent results. */
|
||||
if(fold_case)
|
||||
return strcasecmp(a,b);
|
||||
else
|
||||
return strcmp(a,b);
|
||||
}
|
||||
|
||||
if (fold_case) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue