nlopess         Mon Jan 14 09:46:55 2008 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/pcre/tests     bug42945.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/pcre   php_pcre.c 
  Log:
  MFH: fix bug #42945, as asked by Ilia
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1053&r2=1.2027.2.547.2.1054&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1053 php-src/NEWS:1.2027.2.547.2.1054
--- php-src/NEWS:1.2027.2.547.2.1053    Mon Jan 14 09:39:40 2008
+++ php-src/NEWS        Mon Jan 14 09:46:54 2008
@@ -67,6 +67,7 @@
 - Fixed bug #43105 (PHP seems to fail to close open files). (Hannes)
 - Fixed bug #42978 (mismatch between number of bound params and values causes
   a crash in pdo_pgsql). (Ilia)
+- Fixed bug #42945 (preg_split() swallows part of the string). (Nuno)
 - Fixed bug #42937 (__call() method not invoked when methods are called on
   parent from child class). (Dmitry)
 - Fixed bug #42736 (xmlrpc_server_call_method() crashes). (Tony)
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.23&r2=1.168.2.9.2.24&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.23 
php-src/ext/pcre/php_pcre.c:1.168.2.9.2.24
--- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.23  Mon Dec 31 07:20:09 2007
+++ php-src/ext/pcre/php_pcre.c Mon Jan 14 09:46:54 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.168.2.9.2.23 2007/12/31 07:20:09 sebastian Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.9.2.24 2008/01/14 09:46:54 nlopess Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1535,7 +1535,9 @@
        }
 
 
-       if (!no_empty || start_offset != subject_len)
+       start_offset = last_match - subject; /* the offset might have been 
incremented, but without further successful matches */
+
+       if (!no_empty || start_offset < subject_len)
        {
                if (offset_capture) {
                        /* Add the last (match, offset) pair to the return 
value */

http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug42945.phpt?view=markup&rev=1.1
Index: php-src/ext/pcre/tests/bug42945.phpt
+++ php-src/ext/pcre/tests/bug42945.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to