]> granicus.if.org Git - php/commitdiff
Fixed unicode support for substr_count()
authorDmitry Stogov <dmitry@php.net>
Wed, 7 Sep 2005 07:00:03 +0000 (07:00 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 7 Sep 2005 07:00:03 +0000 (07:00 +0000)
ext/standard/string.c

index c474d9d27bcba828a648097b2c8e7d165a82f360..fbeed23a45316f593c5c265ad9d44dc8831eb9db 100644 (file)
@@ -5273,7 +5273,7 @@ PHP_FUNCTION(substr_count)
        if (haystack_type == IS_UNICODE) {
                while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) {
                        /*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */
-                       p = (UChar *)p + UBYTES(needle_len);
+                       p = (UChar *)p + needle_len;
                        count++;
                }
        } else {