summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-04 13:00:40 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-04 13:00:40 +0000
commit28fbb49c0bfe44142eb36b3891d4d28021a1b277 (patch)
treec50ceaf41820d543272f0ff74a6c19befff75b1f
parent3c58b261528d9590f7c09e220c57feb152b86ad4 (diff)
downloadrockbox-28fbb49c0bfe44142eb36b3891d4d28021a1b277.tar.gz
rockbox-28fbb49c0bfe44142eb36b3891d4d28021a1b277.zip
Fix for:
FS#10031 - "improper sorting of names with underscores when Interpret numbers when sorting is used" and FS#10200 - "Incorrect sorting of roman numerals when whole numbers selected" a) By using tolower instead of toupper for case-insensitive sorting b) By not ignoring spaces (which isn't really what we aimed for anyway). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22153 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/common/strnatcmp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/common/strnatcmp.c b/firmware/common/strnatcmp.c
index 04b760e8e7..3c98200f7e 100644
--- a/firmware/common/strnatcmp.c
+++ b/firmware/common/strnatcmp.c
@@ -58,18 +58,18 @@ nat_isdigit(int a)
58 return isdigit(a); 58 return isdigit(a);
59} 59}
60 60
61 61#if 0
62static inline int 62static inline int
63nat_isspace(int a) 63nat_isspace(int a)
64{ 64{
65 return isspace(a); 65 return isspace(a);
66} 66}
67 67#endif
68 68
69static inline int 69static inline int
70nat_toupper(int a) 70nat_toupper(int a)
71{ 71{
72 return toupper(a); 72 return tolower(a);
73} 73}
74 74
75 75
@@ -139,14 +139,14 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
139 while (1) { 139 while (1) {
140 ca = to_int(a[ai]); 140 ca = to_int(a[ai]);
141 cb = to_int(b[bi]); 141 cb = to_int(b[bi]);
142 142#if 0
143 /* skip over leading spaces or zeros */ 143 /* skip over leading spaces or zeros */
144 while (nat_isspace(ca)) 144 while (nat_isspace(ca))
145 ca = to_int(a[++ai]); 145 ca = to_int(a[++ai]);
146 146
147 while (nat_isspace(cb)) 147 while (nat_isspace(cb))
148 cb = to_int(b[++bi]); 148 cb = to_int(b[++bi]);
149 149#endif
150 /* process run of digits */ 150 /* process run of digits */
151 if (nat_isdigit(ca) && nat_isdigit(cb)) { 151 if (nat_isdigit(ca) && nat_isdigit(cb)) {
152 fractional = (ca == '0' || cb == '0'); 152 fractional = (ca == '0' || cb == '0');