nlopess         Sun Jan 13 14:44:29 2008 UTC

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

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/pcre   php_pcre.c 
  Log:
  Fixed bug #42945 (preg_split() swallows part of the string)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.68&r2=1.2027.2.547.2.965.2.69&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.68 
php-src/NEWS:1.2027.2.547.2.965.2.69
--- php-src/NEWS:1.2027.2.547.2.965.2.68        Sun Jan 13 12:44:56 2008
+++ php-src/NEWS        Sun Jan 13 14:44:28 2008
@@ -71,6 +71,7 @@
 - Fixed bug #43128 (Very long class name causes segfault). (Dmitry)
 - Fixed bug #42952 (soap cache file is created with insecure permissions).
   (Dmitry)
+- Fixed bug #42945 (preg_split() swallows part of the string). (Nuno)
 - Fixed bug #42868 (Floats cast to integer produce unpredictable results).
   (Zoe Slattery)
 - Fixed bug #42848 (Status: header incorrect under FastCGI). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.8&r2=1.168.2.9.2.21.2.9&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.21.2.8 
php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.9
--- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.8      Mon Dec 31 07:17:11 2007
+++ php-src/ext/pcre/php_pcre.c Sun Jan 13 14:44:29 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.8 2007/12/31 07:17:11 sebastian Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.9 2008/01/13 14:44:29 nlopess Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1562,7 +1562,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