1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

fixed server side sorting of case-insensitive strings

The sort module uses ldb_comparison_fold() as the comparison function
for case-insensitive attributes. In other places the function is being
used to produce a boolean, but for sorting we care about ordering.

The n1 - n2 return was sorting by length, not value
This commit is contained in:
Andrew Tridgell 2009-06-10 10:13:55 +10:00
parent b660e51dec
commit 48dbfc89cf

View File

@ -216,9 +216,6 @@ int ldb_comparison_fold(struct ldb_context *ldb, void *mem_ctx,
while (*s1 == ' ') { s1++; n1--; }
while (*s2 == ' ') { s2++; n2--; }
}
if (n1 != n2) {
return n1 - n2;
}
return (int)(toupper(*s1)) - (int)(toupper(*s2));
utf8str: