Piotr Caban : msvcrt: Added _strcoll_l implementation.
Alexandre Julliard
julliard at winehq.org
Thu May 12 13:57:49 CDT 2011
Module: wine
Branch: master
Commit: e07dbe2c0a179c4143422d30c475867a1d452c70
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e07dbe2c0a179c4143422d30c475867a1d452c70
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu May 12 11:39:10 2011 +0200
msvcrt: Added _strcoll_l implementation.
---
dlls/msvcrt/msvcrt.spec | 2 +-
dlls/msvcrt/string.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 1766dbf..605997c 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -919,7 +919,7 @@
@ cdecl _stati64(str ptr) MSVCRT_stati64
@ cdecl _statusfp()
@ cdecl _strcmpi(str str) ntdll._strcmpi
-# stub _strcoll_l(str str ptr)
+@ cdecl _strcoll_l(str str ptr) MSVCRT_strcoll_l
@ cdecl _strdate(ptr)
@ cdecl _strdate_s(ptr long)
@ cdecl _strdup(str)
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index 8316ff7..a3d8d57 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -31,6 +31,7 @@
#include <limits.h>
#include <errno.h>
#include "msvcrt.h"
+#include "winnls.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -527,12 +528,22 @@ int CDECL MSVCRT__atoflt_l( MSVCRT__CRT_FLOAT *value, char *str, MSVCRT__locale_
}
/*********************************************************************
+ * _strcoll_l (MSVCRT.@)
+ */
+int CDECL MSVCRT_strcoll_l( const char* str1, const char* str2, MSVCRT__locale_t locale )
+{
+ if(!locale)
+ locale = get_locale();
+
+ return CompareStringA(locale->locinfo->lc_handle[MSVCRT_LC_CTYPE], 0, str1, -1, str2, -1)-2;
+}
+
+/*********************************************************************
* strcoll (MSVCRT.@)
*/
int CDECL MSVCRT_strcoll( const char* str1, const char* str2 )
{
- /* FIXME: handle Windows locale */
- return strcoll( str1, str2 );
+ return MSVCRT_strcoll_l(str1, str2, NULL);
}
/*********************************************************************
More information about the wine-cvs
mailing list