mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #65947 (basename is no more working after fgetcsv in certain situation)
previous codes: "#define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state)))# it use mbsinit there, seems try to initialize the mblen_state, but: "This function does not change the state identified by ps. Typical ways to make the state pointed by ps an initial state are: memset (ps,0,sizeof(*ps)); // ps points to zero-valued object " http://www.cplusplus.com/reference/cwchar/mbsinit/?kw=mbsinit
This commit is contained in:
parent
fd3fa9b53c
commit
cf2626f10c
3 changed files with 22 additions and 1 deletions
|
@ -156,7 +156,7 @@ PHPAPI char *php_strerror(int errnum);
|
|||
# define php_mblen(ptr, len) 1
|
||||
#else
|
||||
# if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
|
||||
# define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state)))
|
||||
# define php_mblen(ptr, len) ((ptr) == NULL ? memset(&BG(mblen_state), 0, sizeof(BG(mblen_state))): (int)mbrlen(ptr, len, &BG(mblen_state)))
|
||||
# else
|
||||
# define php_mblen(ptr, len) mblen(ptr, len)
|
||||
# endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue