Re: Bug #1210: str_replace does not work when needle at end of haystack
| From: | Stig Venaas | Date: | Sun, 07 Mar 1999 21:12:13 +0000 |
| Subject: | Re: Bug #1210: str_replace does not work when needle at end of haystack | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4519@lists.php.net to get a copy of this message | ||
On Sun, Mar 07, 1999 at 09:28:51PM +0100, Egon Schmid wrote:
> It is correct. What does say -Stig? I got "12a34".
I had a look at the sources, and I think I might have found the bug.
The following lines in _php3_memnstr() in 3.0.6
for(; p < end - needle_len + 1&&
(s = memchr(p, *needle, end - haystack)); p = s + 1) {
have been replaced with
for(; p < end - needle_len &&
(s = memchr(p, *needle, end - p - needle_len)); p = s + 1) {
in 3.0.7.
Stig
--
Stig Venås Tel: +47 73 59 53 29
NTNU Fax: +47 73 59 80 98
ITEA/Nett, Prof. Brochs g. 6
N-7491 Trondheim, Norway E-mail: venaas@itea.ntnu.no
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net