summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/lmessages.c
diff options
context:
space:
mode:
authorphantom <phantom@FreeBSD.org>2001-02-13 15:32:21 +0000
committerphantom <phantom@FreeBSD.org>2001-02-13 15:32:21 +0000
commit83025d71990a74816b7b973ef4249add3cf218be (patch)
treeddbd16f53562fa8b76979a917a43c19692fcfecc /lib/libc/locale/lmessages.c
parentced7256011bf11eb4b07e931bbfa8d5df18d0f9d (diff)
downloadFreeBSD-src-83025d71990a74816b7b973ef4249add3cf218be.zip
FreeBSD-src-83025d71990a74816b7b973ef4249add3cf218be.tar.gz
catch up to __part_load_locale() interface change
Diffstat (limited to 'lib/libc/locale/lmessages.c')
-rw-r--r--lib/libc/locale/lmessages.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/lib/libc/locale/lmessages.c b/lib/libc/locale/lmessages.c
index 99c2adf..8342164 100644
--- a/lib/libc/locale/lmessages.c
+++ b/lib/libc/locale/lmessages.c
@@ -51,23 +51,16 @@ static char * messages_locale_buf;
int
__messages_load_locale(const char *name) {
- int ret;
- ret = __part_load_locale(name, &_messages_using_locale,
- messages_locale_buf, "LC_MESSAGES", LCMESSAGES_SIZE_FULL,
+ /* Propose that we can have incomplete locale file (w/o "{yes,no}str").
+ Initialize them before loading. In case of complete locale, they'll
+ be initialized to loaded value, otherwise they'll not be touched. */
+ _messages_locale.yesstr = empty;
+ _messages_locale.nostr = empty;
+
+ return __part_load_locale(name, &_messages_using_locale,
+ messages_locale_buf, "LC_MESSAGES",
+ LCMESSAGES_SIZE_FULL, LCMESSAGES_SIZE_MIN,
(const char **)&_messages_locale);
- if (ret == 0) {
- /* Assume that we have incomplete locale file (without
- * "yesstr" and "nostr" declared. Try it also.
- */
- ret = __part_load_locale(name, &_messages_using_locale,
- messages_locale_buf, "LC_MESSAGES", LCMESSAGES_SIZE_MIN,
- (const char **)&_messages_locale);
- if (ret == 0) {
- _messages_locale.yesstr = empty;
- _messages_locale.nostr = empty;
- }
- }
- return ret;
}
struct lc_messages_T *
OpenPOWER on IntegriCloud