]> granicus.if.org Git - php/commitdiff
Fixed an iconv_strrpos() bug that the function doesn't return accurate
authorMoriyoshi Koizumi <moriyoshi@php.net>
Fri, 3 Jan 2003 20:01:13 +0000 (20:01 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Fri, 3 Jan 2003 20:01:13 +0000 (20:01 +0000)
position of last occurrence

ext/iconv/iconv.c

index 3c32243c8341e1461745f382e64b781d90256b32..d461ca4f4d10254d9fd1f6127c6b0a368e82d49c 100644 (file)
@@ -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;