summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-07-02 21:46:41 -0400
committerRich Felker <dalias@aerifal.cx>2014-07-02 21:46:41 -0400
commit4c48501ee2a022a0dd207a2db4d346a00f9927a1 (patch)
tree59167ab2975dfdf087be1033c72cd591f4c6e1f0 /src/locale
parent7424ac58b1f47adb03de55de5998c530aee91551 (diff)
downloadmusl-4c48501ee2a022a0dd207a2db4d346a00f9927a1.tar.gz
musl-4c48501ee2a022a0dd207a2db4d346a00f9927a1.tar.bz2
musl-4c48501ee2a022a0dd207a2db4d346a00f9927a1.tar.xz
musl-4c48501ee2a022a0dd207a2db4d346a00f9927a1.zip
properly pass current locale to *_l functions when used internally
this change is presently non-functional since the callees do not yet use their locale argument for anything.
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/langinfo.c3
-rw-r--r--src/locale/strcoll.c3
-rw-r--r--src/locale/strfmon.c3
-rw-r--r--src/locale/strxfrm.c3
-rw-r--r--src/locale/wcscoll.c3
-rw-r--r--src/locale/wcsxfrm.c3
6 files changed, 12 insertions, 6 deletions
diff --git a/src/locale/langinfo.c b/src/locale/langinfo.c
index 7bb56eed..13abf45b 100644
--- a/src/locale/langinfo.c
+++ b/src/locale/langinfo.c
@@ -1,5 +1,6 @@
#include <locale.h>
#include <langinfo.h>
+#include "locale_impl.h"
#include "libc.h"
static const char c_time[] =
@@ -60,7 +61,7 @@ char *__nl_langinfo_l(nl_item item, locale_t loc)
char *__nl_langinfo(nl_item item)
{
- return __nl_langinfo_l(item, 0);
+ return __nl_langinfo_l(item, CURRENT_LOCALE);
}
weak_alias(__nl_langinfo, nl_langinfo);
diff --git a/src/locale/strcoll.c b/src/locale/strcoll.c
index 39ea1123..84f199ff 100644
--- a/src/locale/strcoll.c
+++ b/src/locale/strcoll.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <locale.h>
+#include "locale_impl.h"
#include "libc.h"
int __strcoll_l(const char *l, const char *r, locale_t loc)
@@ -9,7 +10,7 @@ int __strcoll_l(const char *l, const char *r, locale_t loc)
int strcoll(const char *l, const char *r)
{
- return __strcoll_l(l, r, 0);
+ return __strcoll_l(l, r, CURRENT_LOCALE);
}
weak_alias(__strcoll_l, strcoll_l);
diff --git a/src/locale/strfmon.c b/src/locale/strfmon.c
index e25db972..7cf2136a 100644
--- a/src/locale/strfmon.c
+++ b/src/locale/strfmon.c
@@ -3,6 +3,7 @@
#include <stdarg.h>
#include <monetary.h>
#include <errno.h>
+#include "locale_impl.h"
static ssize_t vstrfmon_l(char *s, size_t n, locale_t loc, const char *fmt, va_list ap)
{
@@ -93,7 +94,7 @@ ssize_t strfmon(char *restrict s, size_t n, const char *restrict fmt, ...)
ssize_t ret;
va_start(ap, fmt);
- ret = vstrfmon_l(s, n, 0, fmt, ap);
+ ret = vstrfmon_l(s, n, CURRENT_LOCALE, fmt, ap);
va_end(ap);
return ret;
diff --git a/src/locale/strxfrm.c b/src/locale/strxfrm.c
index 32c46193..14b76a63 100644
--- a/src/locale/strxfrm.c
+++ b/src/locale/strxfrm.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <locale.h>
+#include "locale_impl.h"
#include "libc.h"
/* collate only by code points */
@@ -12,7 +13,7 @@ size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, loca
size_t strxfrm(char *restrict dest, const char *restrict src, size_t n)
{
- return __strxfrm_l(dest, src, n, 0);
+ return __strxfrm_l(dest, src, n, CURRENT_LOCALE);
}
weak_alias(__strxfrm_l, strxfrm_l);
diff --git a/src/locale/wcscoll.c b/src/locale/wcscoll.c
index 20a60900..14bb8b9f 100644
--- a/src/locale/wcscoll.c
+++ b/src/locale/wcscoll.c
@@ -1,5 +1,6 @@
#include <wchar.h>
#include <locale.h>
+#include "locale_impl.h"
#include "libc.h"
/* FIXME: stub */
@@ -10,7 +11,7 @@ int __wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale)
int wcscoll(const wchar_t *l, const wchar_t *r)
{
- return __wcscoll_l(l, r, 0);
+ return __wcscoll_l(l, r, CURRENT_LOCALE);
}
weak_alias(__wcscoll_l, wcscoll_l);
diff --git a/src/locale/wcsxfrm.c b/src/locale/wcsxfrm.c
index 5d89e7dd..0a0b776d 100644
--- a/src/locale/wcsxfrm.c
+++ b/src/locale/wcsxfrm.c
@@ -1,5 +1,6 @@
#include <wchar.h>
#include <locale.h>
+#include "locale_impl.h"
#include "libc.h"
/* collate only by code points */
@@ -17,7 +18,7 @@ size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n
size_t wcsxfrm(wchar_t *restrict dest, const wchar_t *restrict src, size_t n)
{
- return __wcsxfrm_l(dest, src, n, 0);
+ return __wcsxfrm_l(dest, src, n, CURRENT_LOCALE);
}
weak_alias(__wcsxfrm_l, wcsxfrm_l);