diff options
author | Rui Hirokawa <hirokawa@php.net> | 2003-09-23 02:54:28 +0000 |
---|---|---|
committer | Rui Hirokawa <hirokawa@php.net> | 2003-09-23 02:54:28 +0000 |
commit | 5714f48f4cdc700b4fd9b04ad8c6b8003895b765 (patch) | |
tree | 7d0ec9ddfdc8e690f86e011591f4aaae262134ce /ext/mbstring/php_mbregex.c | |
parent | 05331829c67fef7fd9e716c929fd6fd92209de8a (diff) | |
download | php-git-5714f48f4cdc700b4fd9b04ad8c6b8003895b765.tar.gz |
removed unnessesary null byte (patched by komura).
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r-- | ext/mbstring/php_mbregex.c | 16 |
1 files changed, 15 insertions, 1 deletions
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 + */ |