# HG changeset patch # User Bruno Haible # Date 1263161514 -3600 # Node ID 91e18087c6accc751ee476a2204ef99d21fb547e # Parent b982684dce8f2b7f5e10f88428e3e40c83d838d8 unistr/u*-strcoll: Try harder to distinguish different strings. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-10 Bruno Haible + + unistr/u*-strcoll: Try harder to distinguish different strings. + * lib/unistr/u-strcoll.h (FUNC): When sl1 and sl2 are the same, + compare s1 and s2 to see if they are different. + 2010-01-10 Bruno Haible unistr/u*-stpncpy: Fix the return value. diff --git a/lib/unistr/u-strcoll.h b/lib/unistr/u-strcoll.h --- a/lib/unistr/u-strcoll.h +++ b/lib/unistr/u-strcoll.h @@ -41,6 +41,12 @@ /* strcoll succeeded. */ free (sl1); free (sl2); + /* The conversion to locale encoding can do transliteration or + map some characters to question marks. Therefore sl1 and sl2 + may be equal when s1 and s2 were in fact different. Return a + nonzero result in this case. */ + if (result == 0) + result = U_STRCMP (s1, s2); } else {