ICU-2536 Display more consistent results when managing alias conflicts.

X-SVN-Rev: 10842
This commit is contained in:
George Rhoten 2003-01-11 01:26:50 +00:00
parent 95e136cdd2
commit 6b8d91016e

View File

@ -990,7 +990,12 @@ allocString(StringBlock *block, uint32_t length) {
static int static int
compareAliases(const void *alias1, const void *alias2) { compareAliases(const void *alias1, const void *alias2) {
/* Names like IBM850 and ibm-850 need to be sorted together */ /* Names like IBM850 and ibm-850 need to be sorted together */
return ucnv_compareNames(GET_ALIAS_STR(*(uint16_t*)alias1), GET_ALIAS_STR(*(uint16_t*)alias2)); int result = ucnv_compareNames(GET_ALIAS_STR(*(uint16_t*)alias1), GET_ALIAS_STR(*(uint16_t*)alias2));
if (!result) {
/* Sort the shortest first */
return uprv_strlen(GET_ALIAS_STR(*(uint16_t*)alias1)) - uprv_strlen(GET_ALIAS_STR(*(uint16_t*)alias2));
}
return result;
} }
/* /*