This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/4533
- To: nobody at gcc dot gnu dot org
- Subject: Re: libstdc++/4533
- From: Craig Rodrigues <rodrigc at mediaone dot net>
- Date: 14 Oct 2001 19:06:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Craig Rodrigues <rodrigc at mediaone dot net>
The following reply was made to PR libstdc++/4533; it has been noted by GNATS.
From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-patches@gcc.gnu.org
Cc: libstdc++@gcc.gnu.org, gcc-gnats@gcc.gnu.org, brendan@zen.org,
rodrigc@gcc.gnu.org
Subject: Re: libstdc++/4533
Date: Sun, 14 Oct 2001 15:04:27 -0400
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4533&database=gcc
Hi,
Please apply to mainline, to address PR 4533.
2001-10-10 Brendan Kehoe <brendan@zen.org>
* bits/basic_string.tcc (find_first_not_of): Take out check for
__n being non-zero, since the standard does not mandate that.
e.g., a search for "" in "" should yield position 0, not npos.
(find_last_not_of): Likewise.
Index: include/bits/basic_string.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/basic_string.tcc,v
retrieving revision 1.6
diff -u -p -r1.6 basic_string.tcc
--- basic_string.tcc 2001/07/20 00:09:31 1.6
+++ basic_string.tcc 2001/10/10 11:44:12
@@ -698,7 +698,7 @@ namespace std
find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
size_t __xpos = __pos;
- for (; __n && __xpos < this->size(); ++__xpos)
+ for (; __xpos < this->size(); ++__xpos)
if (!traits_type::find(__s, __n, _M_data()[__xpos]))
return __xpos;
return npos;
@@ -722,7 +722,7 @@ namespace std
find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
- if (__size && __n)
+ if (__size)
{
if (--__size > __pos)
__size = __pos;
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net