1 From 6399fa9d29ea83de4735680b77d457bd59606532 Mon Sep 17 00:00:00 2001
2 From: Rich Felker <dalias@aerifal.cx>
3 Date: Thu, 7 Jul 2016 16:51:37 -0400
4 Subject: fix asctime day/month names not to vary by locale
6 the FIXME comment here was overlooked at the time locale support was
9 src/time/__asctime.c | 9 ++++-----
10 1 file changed, 4 insertions(+), 5 deletions(-)
12 diff --git a/src/time/__asctime.c b/src/time/__asctime.c
13 index e7e7f07..f114dfe 100644
14 --- a/src/time/__asctime.c
15 +++ b/src/time/__asctime.c
20 +#include "locale_impl.h"
23 -const char *__nl_langinfo(nl_item);
24 +const char *__nl_langinfo_l(nl_item, locale_t);
26 char *__asctime(const struct tm *restrict tm, char *restrict buf)
28 - /* FIXME: change __nl_langinfo to __nl_langinfo_l with explicit C
29 - * locale once we have locales */
30 if (snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
31 - __nl_langinfo(ABDAY_1+tm->tm_wday),
32 - __nl_langinfo(ABMON_1+tm->tm_mon),
33 + __nl_langinfo_l(ABDAY_1+tm->tm_wday, C_LOCALE),
34 + __nl_langinfo_l(ABMON_1+tm->tm_mon, C_LOCALE),
35 tm->tm_mday, tm->tm_hour,
36 tm->tm_min, tm->tm_sec,
37 1900 + tm->tm_year) >= 26)