summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/setlocale.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-08-04 18:43:01 +0000
committerwollman <wollman@FreeBSD.org>1995-08-04 18:43:01 +0000
commit99cef2aaa79c69732233a84462345b30bef389fc (patch)
tree8641f513c554873ed1c7b7aaa44b82a99dd1fe16 /lib/libc/locale/setlocale.c
parent98a78b7aa4b5b9f0897522f5c0d101215abb82a0 (diff)
downloadFreeBSD-src-99cef2aaa79c69732233a84462345b30bef389fc.zip
FreeBSD-src-99cef2aaa79c69732233a84462345b30bef389fc.tar.gz
Implement locale-sensitive strftime () from ADO (heavily modified
by me). This probably loses for multibyte characters, but I have no way of telling. I'll let ache decide whether to add this support to startup_setlocale. Note that for this to make any sense at all, the symlinks in /usr/share/locale must go. (For the moment, this doesn't make any difference since there are no locales supplied.) Obtained from: Arthur David Olson <ado@elsie.nci.nih.gov>
Diffstat (limited to 'lib/libc/locale/setlocale.c')
-rw-r--r--lib/libc/locale/setlocale.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index 20bcb6a..8066943 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -166,6 +166,14 @@ loadlocale(category)
return (current_categories[LC_COLLATE]);
}
+ if (category == LC_TIME) {
+ if (__time_load_locale(new_categories[LC_TIME]) < 0)
+ return (NULL);
+ strcpy(current_categories[LC_COLLATE],
+ new_categories[LC_COLLATE]);
+ return (current_categories[LC_COLLATE]);
+ }
+
if (!strcmp(new_categories[category], "C") ||
!strcmp(new_categories[category], "POSIX")) {
@@ -188,7 +196,6 @@ loadlocale(category)
switch (category) {
case LC_MONETARY:
case LC_NUMERIC:
- case LC_TIME:
return (NULL);
}
}
OpenPOWER on IntegriCloud