[PATCH] Fix collate_members_char[wchar_t].cc
Ulrich Drepper
drepper@redhat.com
Wed Mar 13 14:02:00 GMT 2002
On Wed, 2002-03-13 at 13:39, Paolo Carlini wrote:
> string str1 = coll_c.transform(strlit1, strlit1 + size1);
> string str2 = coll_c.transform(strlit2, strlit2 + size2);
> - i1 = coll_c.compare(str1.c_str(), str1.c_str() + size1,
> - str2.c_str(), str2.c_str() + size2);
> + i1 = str1.compare(str2);
> i2 = coll_c.compare(strlit1, strlit1 + size1, strlit2, strlit2 + size2);
> - VERIFY(i1 == i2);
> + VERIFY(i2 == 1);
> + VERIFY(i1 * i2 > 0);
The first change is correct, normal string comparison is needed after
the transformation. But the results should still be the same. If you
see a different sign on the return value it could mean that instead
i1 = str2.compare(str1)
must be used (or that .compare is returning the wrong sign which I
doubt). I've not enough time to look into this myself.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20020313/5def0902/attachment.sig>
More information about the Libstdc++
mailing list