From 5714f48f4cdc700b4fd9b04ad8c6b8003895b765 Mon Sep 17 00:00:00 2001 From: Rui Hirokawa Date: Tue, 23 Sep 2003 02:54:28 +0000 Subject: [PATCH] removed unnessesary null byte (patched by komura). --- ext/mbstring/php_mbregex.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 63f84c52b2..488a999b8f 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -557,7 +557,12 @@ _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, int option) } } else { /* nomatch */ /* stick that last bit of string on our output */ - _php_mb_regex_strbuf_ncat(&outdev, (const unsigned char *)&string[pos], string_len - pos); + int l = string_len - pos; + if (l > 0) { + _php_mb_regex_strbuf_ncat(&outdev, (const unsigned char *)&string[pos], l); + } else { + outdev.pos += l; + } } } @@ -1083,3 +1088,12 @@ PHP_FUNCTION(mb_regex_set_options) /* }}} */ #endif /* HAVE_MBREGEX */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: fdm=marker + * vim: noet sw=4 ts=4 + */ -- 2.50.1