cvs: php-src(PHP_5_2) /ext/pcre php_pcre.c /ext/pcre/tests bug37800.phpt
| From: | Nuno Lopes | Date: | Thu, 15 Jun 2006 15:33:25 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/pcre php_pcre.c /ext/pcre/tests bug37800.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38743@lists.php.net to get a copy of this message | ||
nlopess Thu Jun 15 15:33:25 2006 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/pcre/tests bug37800.phpt
Modified files:
/php-src/ext/pcre php_pcre.c
Log:
fix bug #37800: preg_replace() limit parameter odd behaviour
#this is a regression in PHP_5_2 and HEAD branches only
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.5&r2=1.168.2.9.2.6&diff_format=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.5 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.6
--- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.5 Wed Jun 14 17:52:56 2006
+++ php-src/ext/pcre/php_pcre.c Thu Jun 15 15:33:25 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.c,v 1.168.2.9.2.5 2006/06/14 17:52:56 nlopess Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.9.2.6 2006/06/15 15:33:25 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1091,7 +1091,7 @@
if (limit != -1)
limit--;
- } else if (count == PCRE_ERROR_NOMATCH) {
+ } else if (count == PCRE_ERROR_NOMATCH || limit == 0) {
/* If we previously set PCRE_NOTEMPTY after a null match,
this is not necessarily the end. We need to advance
the start offset, and continue. Fudge the offset values
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/bug37800.phpt?view=markup&rev=1.1
Index: php-src/ext/pcre/tests/bug37800.phpt
+++ php-src/ext/pcre/tests/bug37800.phpt