@@ -113,7 +113,7 @@ PHP_FUNCTION(grapheme_strpos)
113
113
unsigned char * found ;
114
114
long loffset = 0 ;
115
115
int32_t offset = 0 ;
116
- int ret_pos , uchar_pos ;
116
+ int ret_pos ;
117
117
118
118
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "ss|l" , (char * * )& haystack , & haystack_len , (char * * )& needle , & needle_len , & loffset ) == FAILURE ) {
119
119
@@ -160,10 +160,10 @@ PHP_FUNCTION(grapheme_strpos)
160
160
}
161
161
162
162
/* do utf16 part of the strpos */
163
- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , & uchar_pos , 0 /* fIgnoreCase */ TSRMLS_CC );
163
+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 0 /* fIgnoreCase */ , 0 /* last */ TSRMLS_CC );
164
164
165
165
if ( ret_pos >= 0 ) {
166
- RETURN_LONG (ret_pos + offset );
166
+ RETURN_LONG (ret_pos );
167
167
} else {
168
168
RETURN_FALSE ;
169
169
}
@@ -180,7 +180,7 @@ PHP_FUNCTION(grapheme_stripos)
180
180
unsigned char * found ;
181
181
long loffset = 0 ;
182
182
int32_t offset = 0 ;
183
- int ret_pos , uchar_pos ;
183
+ int ret_pos ;
184
184
int is_ascii ;
185
185
186
186
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "ss|l" , (char * * )& haystack , & haystack_len , (char * * )& needle , & needle_len , & loffset ) == FAILURE ) {
@@ -235,10 +235,10 @@ PHP_FUNCTION(grapheme_stripos)
235
235
}
236
236
237
237
/* do utf16 part of the strpos */
238
- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , & uchar_pos , 1 /* fIgnoreCase */ TSRMLS_CC );
238
+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 1 /* fIgnoreCase */ , 0 /*last */ TSRMLS_CC );
239
239
240
240
if ( ret_pos >= 0 ) {
241
- RETURN_LONG (ret_pos + offset );
241
+ RETURN_LONG (ret_pos );
242
242
} else {
243
243
RETURN_FALSE ;
244
244
}
@@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos)
304
304
/* else we need to continue via utf16 */
305
305
}
306
306
307
- ret_pos = grapheme_strrpos_utf16 (haystack , haystack_len , needle , needle_len , offset , 0 /* f_ignore_case */ TSRMLS_CC );
307
+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 0 /* f_ignore_case */ , 1 /* last */ TSRMLS_CC );
308
308
309
309
if ( ret_pos >= 0 ) {
310
310
RETURN_LONG (ret_pos );
@@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos)
382
382
/* else we need to continue via utf16 */
383
383
}
384
384
385
- ret_pos = grapheme_strrpos_utf16 (haystack , haystack_len , needle , needle_len , offset , 1 /* f_ignore_case */ TSRMLS_CC );
385
+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 1 /* f_ignore_case */ , 1 /*last */ TSRMLS_CC );
386
386
387
387
if ( ret_pos >= 0 ) {
388
388
RETURN_LONG (ret_pos );
@@ -659,7 +659,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
659
659
}
660
660
661
661
/* need to work in utf16 */
662
- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , 0 , & uchar_pos , f_ignore_case TSRMLS_CC );
662
+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , 0 , & uchar_pos , f_ignore_case , 0 /*last */ TSRMLS_CC );
663
663
664
664
if ( ret_pos < 0 ) {
665
665
RETURN_FALSE ;
0 commit comments