From: Moriyoshi Koizumi Date: Fri, 3 Jan 2003 20:01:13 +0000 (+0000) Subject: Fixed an iconv_strrpos() bug that the function doesn't return accurate X-Git-Tag: PHP_5_0_dev_before_13561_fix~480 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=006b455c6a6b680d4b39a3d39efeb73d5bb7c546;p=php Fixed an iconv_strrpos() bug that the function doesn't return accurate position of last occurrence --- diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 3c32243c83..d461ca4f4d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -910,6 +910,9 @@ static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval, ndl_buf_left -= GENERIC_SUPERSET_NBYTES; if (ndl_buf_left == 0) { *pretval = match_ofs; + ndl_buf_p = ndl_buf; + ndl_buf_left = ndl_buf_len; + match_ofs = -1; } } else { unsigned int i, j, lim;