X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ftime%2Fwcsftime.c;h=7b631f5f74b3571e023532a37ab5564cf0b80644;hb=a512c7d8496d587281a1da41adc02c7785339429;hp=da6c1f8a5e90f42b7ab2e10b8e1cdc11cd5f3088;hpb=400c5e5c8307a2ebe44ef1f203f5a15669f20347;p=musl diff --git a/src/time/wcsftime.c b/src/time/wcsftime.c index da6c1f8a..7b631f5f 100644 --- a/src/time/wcsftime.c +++ b/src/time/wcsftime.c @@ -1,8 +1,11 @@ #include #include #include +#include -size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, const struct tm *restrict tm) +size_t __strftime_l(char *restrict, size_t, const char *restrict, const struct tm *restrict, locale_t); + +size_t __wcsftime_l(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc) { size_t k, n0=n; char out[100], in[4]; @@ -17,7 +20,7 @@ size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, cons in[0] = *f++; if (strchr("EO", (in[1]=*f++))) in[2] = *f++; - k = strftime(out, sizeof out, in, tm); + k = __strftime_l(out, sizeof out, in, tm, loc); if (!k) return 0; k = mbsrtowcs(wcs, (const char *[]){out}, n, 0); if (k==(size_t)-1) return 0; @@ -29,4 +32,7 @@ size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, cons return n0-n; } - +size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, const struct tm *restrict tm) +{ + return __wcsftime_l(wcs, n, f, tm, LC_GLOBAL_LOCALE); +}