aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/locale/tolower.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/locale/tolower.c')
-rw-r--r--lib/libc/locale/tolower.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index 82a78cfdc9b9..f2eb48313c63 100644
--- a/lib/libc/locale/tolower.c
+++ b/lib/libc/locale/tolower.c
@@ -5,6 +5,11 @@
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -36,13 +41,17 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <stdio.h>
#include <runetype.h>
+#include <wchar.h>
+#include "mblocal.h"
__ct_rune_t
-___tolower(c)
+___tolower_l(c, l)
__ct_rune_t c;
+ locale_t l;
{
size_t lim;
- _RuneRange *rr = &_CurrentRuneLocale->__maplower_ext;
+ FIX_LOCALE(l);
+ _RuneRange *rr = &XLOCALE_CTYPE(l)->runes->__maplower_ext;
_RuneEntry *base, *re;
if (c < 0 || c == EOF)
@@ -62,3 +71,9 @@ ___tolower(c)
return(c);
}
+__ct_rune_t
+___tolower(c)
+ __ct_rune_t c;
+{
+ return ___tolower_l(c, __get_locale());
+}