diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1998-04-30 16:50:34 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1998-04-30 16:50:34 +0000 |
| commit | fa41e8ecbe8a1c0d177f09203ff366d91f793230 (patch) | |
| tree | 3cf41b57489597358ef18d7eaa0132a898f31089 /lib | |
| parent | 21358676967547a6ca449cc9d1fb5a5438354e16 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/locale/setlocale.3 | 5 | ||||
| -rw-r--r-- | lib/libc/locale/setlocale.c | 23 |
2 files changed, 16 insertions, 12 deletions
diff --git a/lib/libc/locale/setlocale.3 b/lib/libc/locale/setlocale.3 index 18db81120cd9..c19ad90673ef 100644 --- a/lib/libc/locale/setlocale.3 +++ b/lib/libc/locale/setlocale.3 @@ -88,6 +88,10 @@ alphabetic or non-alphabetic characters, and so on. The real work is done by the .Fn setrunelocale function. +.It Dv LC_MESSAGES +Set a locale for message catalogs, see +.Xr catopen 3 +function. .It Dv LC_MONETARY Set a locale for formatting monetary values; this affects the @@ -287,6 +291,7 @@ and the category .Xr rune 3 , .Xr strcoll 3 , .Xr strxfrm 3 , +.Xr catopen 3 , .Xr euc 4 , .Xr utf2 4 .Sh STANDARDS diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c index 4ec8e4466081..45c5e5ac4343 100644 --- a/lib/libc/locale/setlocale.c +++ b/lib/libc/locale/setlocale.c @@ -33,12 +33,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: setlocale.c,v 1.8.2.7 1997/09/14 13:09:02 jkh Exp $ + * $Id: setlocale.c,v 1.23 1998/04/29 22:39:56 ache Exp $ */ #ifdef LIBC_RCS static const char rcsid[] = - "$Id: setlocale.c,v 1.8.2.7 1997/09/14 13:09:02 jkh Exp $"; + "$Id: setlocale.c,v 1.23 1998/04/29 22:39:56 ache Exp $"; #endif #if defined(LIBC_SCCS) && !defined(lint) @@ -66,6 +66,7 @@ static char *categories[_LC_LAST] = { "LC_MONETARY", "LC_NUMERIC", "LC_TIME", + "LC_MESSAGES", }; /* @@ -78,6 +79,7 @@ static char current_categories[_LC_LAST][ENCODING_LEN + 1] = { "C", "C", "C", + "C", }; /* @@ -200,15 +202,10 @@ currentlocale() for (i = 2; i < _LC_LAST; ++i) if (strcmp(current_categories[1], current_categories[i])) { - (void) strcpy(current_locale_string, current_categories[1]); - (void) strcat(current_locale_string, "/"); - (void) strcat(current_locale_string, current_categories[2]); - (void) strcat(current_locale_string, "/"); - (void) strcat(current_locale_string, current_categories[3]); - (void) strcat(current_locale_string, "/"); - (void) strcat(current_locale_string, current_categories[4]); - (void) strcat(current_locale_string, "/"); - (void) strcat(current_locale_string, current_categories[5]); + for (i = 2; i < _LC_LAST; ++i) { + (void) strcat(current_locale_string, "/"); + (void) strcat(current_locale_string, current_categories[i]); + } break; } return (current_locale_string); @@ -278,7 +275,9 @@ loadlocale(category) return (ret); } - if (category == LC_MONETARY || category == LC_NUMERIC) { + if (category == LC_MONETARY || + category == LC_MESSAGES || + category == LC_NUMERIC) { ret = stub_load_locale(new) ? NULL : new; if (!ret) (void)stub_load_locale(old); |
