diff options
author | ache <ache@FreeBSD.org> | 1998-04-29 22:39:56 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1998-04-29 22:39:56 +0000 |
commit | 9cd3e70e4dce20dfccbb86cd15ff379add65d9a7 (patch) | |
tree | a16608c9b91ebadec1f859af12ebe727e4b94972 /lib/libc/locale/setlocale.c | |
parent | 71fc3af9ecf7cea8b60c9d18488a0535922a4a35 (diff) | |
download | FreeBSD-src-9cd3e70e4dce20dfccbb86cd15ff379add65d9a7.zip FreeBSD-src-9cd3e70e4dce20dfccbb86cd15ff379add65d9a7.tar.gz |
Basic support for LC_MESSAGES
Diffstat (limited to 'lib/libc/locale/setlocale.c')
-rw-r--r-- | lib/libc/locale/setlocale.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c index 4b86a81..ac8729d 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.21 1997/04/07 08:54:35 ache Exp $ + * $Id: setlocale.c,v 1.22 1998/01/15 09:58:07 jb Exp $ */ #ifdef LIBC_RCS static const char rcsid[] = - "$Id: setlocale.c,v 1.21 1997/04/07 08:54:35 ache Exp $"; + "$Id: setlocale.c,v 1.22 1998/01/15 09:58:07 jb 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); |