hirokawa                Mon Sep 22 22:47:07 2003 EDT

  Modified files:              
    /php-src/ext/mbstring       php_mbregex.c 
  Log:
  fixed wrong string length in mbregex.
  
Index: php-src/ext/mbstring/php_mbregex.c
diff -u php-src/ext/mbstring/php_mbregex.c:1.42 php-src/ext/mbstring/php_mbregex.c:1.43
--- php-src/ext/mbstring/php_mbregex.c:1.42     Mon Sep 22 22:43:04 2003
+++ php-src/ext/mbstring/php_mbregex.c  Mon Sep 22 22:47:06 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_mbregex.c,v 1.42 2003/09/23 02:43:04 hirokawa Exp $ */
+/* $Id: php_mbregex.c,v 1.43 2003/09/23 02:47:06 hirokawa Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -653,8 +653,12 @@
                        }
                } else { /* nomatch */
                        /* stick that last bit of string on our output */
-                       if ((UChar *)(string + string_len) > pos)
-                               smart_str_appendl(&out_buf, pos, (size_t)((UChar 
*)(string + string_len) - pos));
+                       int l = (UChar *)(string + string_len) - pos;
+                       if (l > 0) {
+                               smart_str_appendl(&out_buf, pos, l);
+                       } else {
+                               out_buf.len += l;
+                       }
                }
                php_mb_regex_region_free(regs, 0);
        }

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

Reply via email to