msvcrt: Don't call invalid parameter handler when string to be tokenized and context are not set in mbstok.

This commit is contained in:
Piotr Caban 2013-06-21 12:17:33 +02:00 committed by Alexandre Julliard
parent e1b4334f89
commit 779c1f8049
9 changed files with 19 additions and 7 deletions

View File

@ -25,6 +25,7 @@
#include "stdlib.h"
#include "errno.h"
#include "malloc.h"
#include "mbstring.h"
#include "limits.h"
#include "sys/stat.h"
#include "windef.h"
@ -489,6 +490,11 @@ int CDECL MSVCR100_atoi(const char *str)
return _atoi_l(str, NULL);
}
unsigned char* CDECL MSVCR100__mbstok(unsigned char *str, const unsigned char *delim)
{
return _mbstok_l(str, delim, NULL);
}
/*********************************************************************
* DllMain (MSVCR100.@)
*/

View File

@ -1182,7 +1182,7 @@
@ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok
@ cdecl _mbstok(str str) MSVCR100__mbstok
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l

View File

@ -1544,7 +1544,7 @@
@ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok
@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l

View File

@ -468,7 +468,7 @@
@ cdecl _mbsspn(str str) msvcrt._mbsspn
@ cdecl _mbsspnp(str str) msvcrt._mbsspnp
@ cdecl _mbsstr(str str) msvcrt._mbsstr
@ cdecl _mbstok(str str) msvcrt._mbstok
@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstrlen(str) msvcrt._mbstrlen
@ cdecl _mbsupr(str) msvcrt._mbsupr
@ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy

View File

@ -463,7 +463,7 @@
@ cdecl _mbsspn(str str) msvcrt._mbsspn
@ cdecl _mbsspnp(str str) msvcrt._mbsspnp
@ cdecl _mbsstr(str str) msvcrt._mbsstr
@ cdecl _mbstok(str str) msvcrt._mbstok
@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstrlen(str) msvcrt._mbstrlen
@ cdecl _mbsupr(str) msvcrt._mbsupr
@ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy

View File

@ -853,7 +853,7 @@
@ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok
@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l

View File

@ -831,7 +831,7 @@
@ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok
@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l

View File

@ -1149,7 +1149,12 @@ unsigned char* CDECL _mbstok_l(unsigned char *str,
*/
unsigned char* CDECL _mbstok(unsigned char *str, const unsigned char *delim)
{
return _mbstok_s_l(str, delim, &msvcrt_get_thread_data()->mbstok_next, NULL);
thread_data_t *data = msvcrt_get_thread_data();
if(!str && !data->mbstok_next)
return NULL;
return _mbstok_s_l(str, delim, &data->mbstok_next, NULL);
}
/*********************************************************************

View File

@ -102,6 +102,7 @@ size_t __cdecl _mbsspn(const unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbsspnp(const unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbsstr(const unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbstok(unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbstok_l(unsigned char*,const unsigned char*,_locale_t);
unsigned char* __cdecl _mbsupr(unsigned char*);
#ifndef _MBLEADTRAIL_DEFINED