incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: rw_match() bug
Date Wed, 28 Jun 2006 01:08:23 GMT
Martin Sebor wrote:
> The only way to make rw_match() safe w/o changing the interface
> of the function is to pass in the actual length of one of the
> strings as the third argument and encode the length of the other
> in the string itself.

I implemented the new "directive" and modified the replace test
to see how much work it is. It's not too bad. I had to change
a whole bunch of test cases but it was a simple search and
replace. The "hardest" part was fixing the formatting (the
NUL character directive is wider than simple '\0').

While I did this I decided to generalize the directive to handle
Unicode characters (i.e., <Uxxx...> where xxx is an arbitrarily
long sequence of hex digits denoting the value of a Unicode
character; e.g., <U0> is the same as \0, as are <U00>, <U000>,
and <U0000>, etc.). This will come in handy when testing
iostreams and locale (codecvt).

The patches for char.cpp and 21.string.replace.cpp as well as
one for the 0.char.cpp test are attached. I haven't committed
anything yet because it would break all the other tests. If it
looks good to you would you mind starting to change the rest
of the string tests according to replace? You can just post
whatever you've got by the end of your day and I'll pick up
where you leave off and commit the whole thing (or, if you
manage to do them all, feel free to commit it yourself).


View raw message