View | Details | Raw Unified | Return to bug 211743 | Differences between
and this patch

Collapse All | Expand All

(-)./msgcat.c (-4 / +8 lines)
Lines 47-62 Link Here
47
#include <errno.h>
47
#include <errno.h>
48
#include <fcntl.h>
48
#include <fcntl.h>
49
#include <limits.h>
49
#include <limits.h>
50
#include <locale.h>
51
#include <nl_types.h>
50
#include <nl_types.h>
52
#include <pthread.h>
51
#include <pthread.h>
53
#include <stdio.h>
52
#include <stdio.h>
54
#include <stdlib.h>
53
#include <stdlib.h>
55
#include <string.h>
54
#include <string.h>
56
#include <unistd.h>
55
#include <unistd.h>
56
#include <xlocale.h>
57
#include "un-namespace.h"
57
#include "un-namespace.h"
58
58
59
#include "../locale/setlocale.h"        /* for ENCODING_LEN */
59
#include "../locale/setlocale.h"        /* for ENCODING_LEN */
60
#include "../locale/xlocale_private.h"
60
61
61
#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L"
62
#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L"
62
63
Lines 118-123 Link Here
118
	char *base, *cptr, *cptr1, *lang, *nlspath, *pathP, *pcode;
119
	char *base, *cptr, *cptr1, *lang, *nlspath, *pathP, *pcode;
119
	char *plang, *pter, *tmpptr;
120
	char *plang, *pter, *tmpptr;
120
	int saverr, spcleft;
121
	int saverr, spcleft;
122
	locale_t loc;
121
	char path[PATH_MAX];
123
	char path[PATH_MAX];
122
124
123
	/* sanity checking */
125
	/* sanity checking */
Lines 128-136 Link Here
128
		/* have a pathname */
130
		/* have a pathname */
129
		lang = NULL;
131
		lang = NULL;
130
	else {
132
	else {
131
		if (type == NL_CAT_LOCALE)
133
		if (type == NL_CAT_LOCALE) {
132
			lang = setlocale(LC_MESSAGES, NULL);
134
			loc = __get_locale();
133
		else
135
			FIX_LOCALE(loc);
136
			lang = querylocale(LC_MESSAGES_MASK, loc);
137
		} else
134
			lang = getenv("LANG");
138
			lang = getenv("LANG");
135
139
136
		if (lang == NULL || *lang == '\0' || strlen(lang) > ENCODING_LEN ||
140
		if (lang == NULL || *lang == '\0' || strlen(lang) > ENCODING_LEN ||

Return to bug 211743