Piotr Caban : msvcrt: Added _Getdays implementation.

Alexandre Julliard julliard at winehq.org
Wed Dec 7 13:57:14 CST 2011


Module: wine
Branch: master
Commit: 7a43f0cb8f2dcc3766256ebc81a62ae71689657a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7a43f0cb8f2dcc3766256ebc81a62ae71689657a

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Dec  7 13:49:09 2011 +0100

msvcrt: Added _Getdays implementation.

---

 dlls/msvcrt/locale.c |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index aa5fe84..00cb0a9 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -419,13 +419,33 @@ MSVCRT_wchar_t* CDECL MSVCRT__wsetlocale(int category, const MSVCRT_wchar_t* loc
 /*********************************************************************
  *		_Getdays (MSVCRT.@)
  */
-const char* CDECL _Getdays(void)
+char* CDECL _Getdays(void)
 {
-  static const char MSVCRT_days[] = ":Sun:Sunday:Mon:Monday:Tue:Tuesday:Wed:"
-                            "Wednesday:Thu:Thursday:Fri:Friday:Sat:Saturday";
-  /* FIXME: Use locale */
-  TRACE("(void) semi-stub\n");
-  return MSVCRT_days;
+    MSVCRT___lc_time_data *cur = get_locinfo()->lc_time_curr;
+    int i, len, size;
+    char *out;
+
+    TRACE("\n");
+
+    size = cur->str[2*7]-cur->str[0];
+    out = MSVCRT_malloc(size+1);
+    if(!out)
+        return NULL;
+
+    size = 0;
+    for(i=0; i<7; i++) {
+        out[size++] = ':';
+        len = strlen(cur->str[i]);
+        memcpy(&out[size], cur->str[i], len);
+        size += len;
+
+        out[size++] = ':';
+        len = strlen(cur->str[7+i]);
+        memcpy(&out[size], cur->str[7+i], len);
+        size += len;
+    }
+
+    return out;
 }
 
 /*********************************************************************




More information about the wine-cvs mailing list