FreeBSD Bugzilla – Attachment 173974 Details for
Bug 211743
[PATCH] newlocale() and/or uselocale() not working properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Make catopen() understand threaded locale
nlspatch.txt (text/plain), 1.20 KB, created by
Andrey A. Chernov
on 2016-08-23 17:45:46 UTC
(
hide
)
Description:
Make catopen() understand threaded locale
Filename:
MIME Type:
Creator:
Andrey A. Chernov
Created:
2016-08-23 17:45:46 UTC
Size:
1.20 KB
patch
obsolete
>--- /usr/src/lib/libc/nls/msgcat.c 2016-07-22 16:46:48.449655000 +0300 >+++ ./msgcat.c 2016-08-23 20:43:02.603807000 +0300 >@@ -47,16 +47,17 @@ > #include <errno.h> > #include <fcntl.h> > #include <limits.h> >-#include <locale.h> > #include <nl_types.h> > #include <pthread.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > #include <unistd.h> >+#include <xlocale.h> > #include "un-namespace.h" > > #include "../locale/setlocale.h" /* for ENCODING_LEN */ >+#include "../locale/xlocale_private.h" > > #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" > >@@ -118,6 +119,7 @@ > char *base, *cptr, *cptr1, *lang, *nlspath, *pathP, *pcode; > char *plang, *pter, *tmpptr; > int saverr, spcleft; >+ locale_t loc; > char path[PATH_MAX]; > > /* sanity checking */ >@@ -128,9 +130,11 @@ > /* have a pathname */ > lang = NULL; > else { >- if (type == NL_CAT_LOCALE) >- lang = setlocale(LC_MESSAGES, NULL); >- else >+ if (type == NL_CAT_LOCALE) { >+ loc = __get_locale(); >+ FIX_LOCALE(loc); >+ lang = querylocale(LC_MESSAGES_MASK, loc); >+ } else > lang = getenv("LANG"); > > if (lang == NULL || *lang == '\0' || strlen(lang) > ENCODING_LEN ||
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211743
:
173530
|
173973
| 173974 |
190563
|
190564
|
190565