diff options
| -rw-r--r-- | lib/libc/locale/lmessages.c | 25 | ||||
| -rw-r--r-- | lib/libc/locale/lmonetary.c | 3 | ||||
| -rw-r--r-- | lib/libc/locale/lnumeric.c | 3 | ||||
| -rw-r--r-- | lib/libc/stdtime/timelocal.c | 2 | 
4 files changed, 14 insertions, 19 deletions
| diff --git a/lib/libc/locale/lmessages.c b/lib/libc/locale/lmessages.c index 99c2adf16702..8342164ff572 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 * diff --git a/lib/libc/locale/lmonetary.c b/lib/libc/locale/lmonetary.c index f016d85d6479..7ecfba595639 100644 --- a/lib/libc/locale/lmonetary.c +++ b/lib/libc/locale/lmonetary.c @@ -66,7 +66,8 @@ __monetary_load_locale(const char *name) {  	int ret;  	__mlocale_changed = 1;  	ret = __part_load_locale(name, &_monetary_using_locale, -		monetary_locale_buf, "LC_MONETARY", LCMONETARY_SIZE, +		monetary_locale_buf, "LC_MONETARY", +		LCMONETARY_SIZE, LCMONETARY_SIZE,  		(const char **)&_monetary_locale);  	if (ret == 0 && _monetary_using_locale)  		_monetary_locale.mon_grouping = diff --git a/lib/libc/locale/lnumeric.c b/lib/libc/locale/lnumeric.c index 7b6e4b3e623a..e74321a4295e 100644 --- a/lib/libc/locale/lnumeric.c +++ b/lib/libc/locale/lnumeric.c @@ -54,7 +54,8 @@ __numeric_load_locale(const char *name) {  	__nlocale_changed = 1;  	ret = __part_load_locale(name, &_numeric_using_locale, -		numeric_locale_buf, "LC_NUMERIC", LCNUMERIC_SIZE, +		numeric_locale_buf, "LC_NUMERIC", +		LCNUMERIC_SIZE, LCNUMERIC_SIZE,  		(const char **)&_numeric_locale);  	if (ret == 0 && _numeric_using_locale)  		_numeric_locale.grouping = diff --git a/lib/libc/stdtime/timelocal.c b/lib/libc/stdtime/timelocal.c index 27982a3536b3..ab89789b580a 100644 --- a/lib/libc/stdtime/timelocal.c +++ b/lib/libc/stdtime/timelocal.c @@ -106,7 +106,7 @@ __time_load_locale(const char *name) {  	int	ret;  	ret = __part_load_locale(name, &_time_using_locale, -			time_locale_buf, "LC_TIME", LCTIME_SIZE, +			time_locale_buf, "LC_TIME", LCTIME_SIZE, LCTIME_SIZE,  			(const char **)&_time_locale);  	/* XXX: always overwrite for ctime format parsing compatibility */ | 
