Skip to content

Commit abf83e5

Browse files
committed
Rename php_mb_safe_strrchr_ex to php_mb_safe_strrchr
...And remove the original php_mb_safe_strrchr, which was not being used anywhere.
1 parent 0663c64 commit abf83e5

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

ext/mbstring/mbstring.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ static char *php_mb_rfc1867_basename(const zend_encoding *encoding, char *filena
651651
* the full path of the file on the user's filesystem, which means that unless
652652
* the user does basename() they get a bogus file name. Until IE's user base drops
653653
* to nill or problem is fixed this code must remain enabled for all systems. */
654-
s = php_mb_safe_strrchr_ex(filename, '\\', filename_len, (const mbfl_encoding *)encoding);
655-
s2 = php_mb_safe_strrchr_ex(filename, '/', filename_len, (const mbfl_encoding *)encoding);
654+
s = php_mb_safe_strrchr(filename, '\\', filename_len, (const mbfl_encoding *)encoding);
655+
s2 = php_mb_safe_strrchr(filename, '/', filename_len, (const mbfl_encoding *)encoding);
656656

657657
if (s && s2) {
658658
if (s > s2) {
@@ -4229,8 +4229,7 @@ MBSTRING_API size_t php_mb_mbchar_bytes(const char *s)
42294229
}
42304230
/* }}} */
42314231

4232-
/* {{{ MBSTRING_API char *php_mb_safe_strrchr_ex() */
4233-
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)
4232+
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)
42344233
{
42354234
const char *p = s;
42364235
char *last=NULL;
@@ -4268,14 +4267,6 @@ MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t
42684267
}
42694268
return last;
42704269
}
4271-
/* }}} */
4272-
4273-
/* {{{ MBSTRING_API char *php_mb_safe_strrchr() */
4274-
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes)
4275-
{
4276-
return php_mb_safe_strrchr_ex(s, c, nbytes, MBSTRG(internal_encoding));
4277-
}
4278-
/* }}} */
42794270

42804271
/* {{{ MBSTRING_API int php_mb_stripos() */
42814272
MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t old_haystack_len, const char *old_needle, size_t old_needle_len, zend_long offset, const mbfl_encoding *enc)

ext/mbstring/mbstring.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ PHP_RINIT_FUNCTION(mbstring);
5353
PHP_RSHUTDOWN_FUNCTION(mbstring);
5454
PHP_MINFO_FUNCTION(mbstring);
5555

56-
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
57-
size_t nbytes, const mbfl_encoding *enc);
58-
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
59-
size_t nbytes);
56+
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc);
6057

6158
MBSTRING_API char *php_mb_convert_encoding_ex(
6259
const char *input, size_t length,

0 commit comments

Comments
 (0)