moriyoshi               Fri Sep 26 13:47:11 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/mbstring       php_mbregex.c 
  Log:
  MFH(r-1.45): repatch fixes for the problem that was reported at [EMAIL PROTECTED] 
(#884)
  
  
Index: php-src/ext/mbstring/php_mbregex.c
diff -u php-src/ext/mbstring/php_mbregex.c:1.18.2.9 
php-src/ext/mbstring/php_mbregex.c:1.18.2.10
--- php-src/ext/mbstring/php_mbregex.c:1.18.2.9 Mon Sep 22 22:54:28 2003
+++ php-src/ext/mbstring/php_mbregex.c  Fri Sep 26 13:47:10 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_mbregex.c,v 1.18.2.9 2003/09/23 02:54:28 hirokawa Exp $ */
+/* $Id: php_mbregex.c,v 1.18.2.10 2003/09/26 17:47:10 moriyoshi Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -507,7 +507,7 @@
                }
                if (err >= 0) {
 #if moriyoshi_0
-                       if ( regs.beg[0] == regs.end[0] ) {
+                       if (regs.beg[0] == regs.end[0]) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty 
regular expression");
                                break;
                        }
@@ -552,16 +552,15 @@
                        if (pos < n) {
                                pos = n;
                        } else {
-                               _php_mb_regex_strbuf_ncat(&outdev, (const unsigned 
char *)&string[pos], 1 ); 
+                               if (pos < string_len) {
+                                       _php_mb_regex_strbuf_ncat(&outdev, (const 
unsigned char *)&string[pos], 1);
+                               }
                                pos++;
                        }
                } else { /* nomatch */
                        /* stick that last bit of string on our output */
-                       int l = string_len - pos;
-                       if (l > 0) {
-                               _php_mb_regex_strbuf_ncat(&outdev, (const unsigned 
char *)&string[pos], l);
-                       } else {
-                               outdev.pos += l;
+                       if (pos < string_len) {
+                               _php_mb_regex_strbuf_ncat(&outdev, (const unsigned 
char *)&string[pos], string_len - pos);
                        }
                }
        }

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

Reply via email to