cvs: php-src /ext/mbstring php_mbregex.c
| From: | Rui Hirokawa | Date: | Tue, 23 Sep 2003 02:47:07 +0000 |
| Subject: | cvs: php-src /ext/mbstring php_mbregex.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-23846@lists.php.net to get a copy of this message | ||
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);
}