From d32bc75a2f985f1e5c4186cbb56de10c47c68639 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 12 May 2011 11:39:31 +0200 Subject: [PATCH] msvcrt: Added _strncoll_l implementation. --- dlls/msvcrt/msvcrt.spec | 4 ++-- dlls/msvcrt/string.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 958c6cbd6b6..e7294a552a3 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -934,8 +934,8 @@ @ cdecl _strlwr_l(str ptr) @ cdecl _strlwr_s(ptr long) @ cdecl _strlwr_s_l(ptr long ptr) -@ stub _strncoll(str str long) -# stub _strncoll_l(str str long ptr) +@ cdecl _strncoll(str str long) MSVCRT_strncoll_l +@ cdecl _strncoll_l(str str long ptr) MSVCRT_strncoll @ cdecl _strnicmp(str str long) ntdll._strnicmp # stub _strnicmp_l(str str long ptr) @ stub _strnicoll(str str long) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 1e7e8909763..b6fe68b0bbd 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -567,6 +567,25 @@ int CDECL MSVCRT__stricoll( const char* str1, const char* str2 ) } /********************************************************************* + * _strncoll_l (MSVCRT.@) + */ +int CDECL MSVCRT_strncoll_l( const char* str1, const char* str2, MSVCRT_size_t count, MSVCRT__locale_t locale ) +{ + if(!locale) + locale = get_locale(); + + return CompareStringA(locale->locinfo->lc_handle[MSVCRT_LC_CTYPE], 0, str1, count, str2, count)-2; +} + +/********************************************************************* + * strncoll (MSVCRT.@) + */ +int CDECL MSVCRT_strncoll( const char* str1, const char* str2, MSVCRT_size_t count ) +{ + return MSVCRT_strncoll_l(str1, str2, count, NULL); +} + +/********************************************************************* * strcpy_s (MSVCRT.@) */ int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src ) -- 2.11.4.GIT