public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/9817: collate::compare doesn't handle nul characters.
@ 2003-03-09 15:04 paolo
0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2003-03-09 15:04 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, peturr02
Synopsis: collate::compare doesn't handle nul characters.
State-Changed-From-To: analyzed->closed
State-Changed-By: paolo
State-Changed-When: Sun Mar 9 15:04:34 2003
State-Changed-Why:
Fixed for 3.3 and 3.4.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9817
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/9817: collate::compare doesn't handle nul characters.
@ 2003-02-24 13:37 paolo
0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2003-02-24 13:37 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, paolo, peturr02
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
Synopsis: collate::compare doesn't handle nul characters.
Responsible-Changed-From-To: paolo->nobody
Responsible-Changed-By: paolo
Responsible-Changed-When: Mon Feb 24 13:37:34 2003
Responsible-Changed-Why:
Pétur is working on a patch.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9817
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/9817: collate::compare doesn't handle nul characters.
@ 2003-02-23 13:36 paolo
0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2003-02-23 13:36 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, paolo, peturr02
Synopsis: collate::compare doesn't handle nul characters.
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Sun Feb 23 13:36:24 2003
Responsible-Changed-Why:
Working on it.
State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Sun Feb 23 13:36:24 2003
State-Changed-Why:
Confirmed. The reason is simple: compare is implemented in
terms of strcoll (config/locale/*/collate_members.cc). The
same can be said for transform (strxfrm). Instead, a driver
should continue if necessary past any '\0' (basically
when the first hunk compares equal) and invoke repeatedly
the underlying C functions. Will do...
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9817
^ permalink raw reply [flat|nested] 4+ messages in thread
* libstdc++/9817: collate::compare doesn't handle nul characters.
@ 2003-02-23 12:06 peturr02
0 siblings, 0 replies; 4+ messages in thread
From: peturr02 @ 2003-02-23 12:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 9817
>Category: libstdc++
>Synopsis: collate::compare doesn't handle nul characters.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Feb 23 12:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: peturr02@ru.is
>Release: gcc-3.2.1
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
collate::compare stops when it finds a nul character in the string, thus the strings "a\0a" and "a\0b" compare equal.
>How-To-Repeat:
See attachment.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="collatebug.cc"
Content-Disposition: inline; filename="collatebug.cc"
#include <locale>
#undef NDEBUG
#include <cassert>
int main()
{
using namespace std;
typedef collate<char> collate_type;
locale loc = locale::classic();
const collate_type& coll = use_facet<collate_type>(loc);
char str1[] = { 'a', '\0', 'a' };
char str2[] = { 'a', '\0', 'b' };
assert(coll.compare(str1, str1 + 3, str2, str2 + 3) < 0);
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-03-09 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-09 15:04 libstdc++/9817: collate::compare doesn't handle nul characters paolo
-- strict thread matches above, loose matches on Subject: below --
2003-02-24 13:37 paolo
2003-02-23 13:36 paolo
2003-02-23 12:06 peturr02
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).