Ticket #543 - Sorting with attributes in ldapsearch gives incorrect result
Bug description: In the server side sorting compare function
compare_entries_sv, if multiple attribute types are specified,
the sort spec for each attribute is scanned one by one in the
for loop. In the for loop, instead of using the "current"
spec, the first spec is kept using. If the attribute types
have different syntaxes (e.g., cis, tel), then the first
syntax is unexpectedly selected for the second syntax.
Fix description: This patch correctly uses the current spec
in the for loop.
Reviewed by Nathan (Thank you!!)
(cherry picked from commit 95f425da43b380163c2ddae66fc77d2b863a00e5)