ref: b5c01b5d701dc1c3bbca24175041390a3c4a3db3
parent: 22c3bdf20b42098542640447cd409de2b999e23b
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Aug 27 07:44:57 EDT 2021
libc: Update locale to last version This code is being updated out of the tree of scc and it is time to synchroniza both copies now.
--- a/src/libc/locale/localeconv.c
+++ b/src/libc/locale/localeconv.c
@@ -1,5 +1,6 @@
-#include <locale.h>
#include <limits.h>
+#include <locale.h>
+
#undef localeconv
struct lconv *
@@ -20,10 +21,16 @@
.p_cs_precedes = CHAR_MAX,
.n_cs_precedes = CHAR_MAX,
.p_sep_by_space = CHAR_MAX,
- .p_sign_posn = CHAR_MAX,
.n_sep_by_space = CHAR_MAX,
+ .p_sign_posn = CHAR_MAX,
.n_sign_posn = CHAR_MAX,
.int_frac_digits = CHAR_MAX,
+ .int_p_cs_precedes = CHAR_MAX,
+ .int_n_cs_precedes = CHAR_MAX,
+ .int_p_sep_by_space = CHAR_MAX,
+ .int_n_sep_by_space = CHAR_MAX,
+ .int_p_sign_posn = CHAR_MAX,
+ .int_n_sign_posn = CHAR_MAX,
};
return &lc;
}
--- a/src/libc/locale/setlocale.c
+++ b/src/libc/locale/setlocale.c
@@ -1,5 +1,5 @@
#include <locale.h>
-#include <stddef.h>
+
#undef setlocale
char *
@@ -7,9 +7,9 @@
{
if (category > LC_TIME || category < LC_ALL)
return NULL;
- if (!locale ||
- locale[0] == '\0' ||
- locale[0] == 'C' && locale[1] == '\0') {
+ if (!locale
+ || locale[0] == '\0'
+ || locale[0] == 'C' && locale[1] == '\0') {
return "C";
}
return NULL;