mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Remove transition period hack
This commit is contained in:
parent
d5a6e6e7aa
commit
0c7fbc6c40
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116134
@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "lmonetary.h"
|
||||
#include "lmessages.h"
|
||||
|
||||
#define TRANSITION_PERIOD_HACK
|
||||
|
||||
#define _REL(BASE) ((int)item-BASE)
|
||||
|
||||
char *
|
||||
@ -47,42 +45,15 @@ nl_langinfo(nl_item item) {
|
||||
|
||||
char *ret, *s, *cs;
|
||||
static char *csym = NULL;
|
||||
#ifdef TRANSITION_PERIOD_HACK
|
||||
static char *cset = NULL;
|
||||
#endif /* TRANSITION_PERIOD_HACK */
|
||||
|
||||
switch (item) {
|
||||
case CODESET:
|
||||
ret = "";
|
||||
if ((s = setlocale(LC_CTYPE, NULL)) != NULL) {
|
||||
if ((cs = strchr(s, '.')) != NULL) {
|
||||
if ((cs = strchr(s, '.')) != NULL)
|
||||
ret = cs + 1;
|
||||
#ifdef TRANSITION_PERIOD_HACK
|
||||
if (strncmp(ret, "ISO_", 4) == 0) {
|
||||
int slen = strlen(ret);
|
||||
|
||||
if ((cset = reallocf(cset, slen)) != NULL) {
|
||||
strcpy(cset, "ISO");
|
||||
strcat(cset, ret + 4);
|
||||
ret = cset;
|
||||
} else
|
||||
ret = "";
|
||||
} else if (strcmp(ret, "EUC") == 0) {
|
||||
if (strncmp(s, "ja_JP", 5) == 0)
|
||||
ret = "eucJP";
|
||||
else if (strncmp(s, "ko_KR", 5) == 0)
|
||||
ret = "eucKR";
|
||||
else if (strncmp(s, "zh_CN", 5) == 0)
|
||||
ret = "eucCN";
|
||||
} else if (strcmp(ret, "ASCII") == 0)
|
||||
ret = "US-ASCII";
|
||||
#endif /* TRANSITION_PERIOD_HACK */
|
||||
} else if (strcmp(s, "C") == 0 ||
|
||||
strcmp(s, "POSIX") == 0
|
||||
#ifdef TRANSITION_PERIOD_HACK
|
||||
|| strstr(s, "ASCII") != NULL
|
||||
#endif /* TRANSITION_PERIOD_HACK */
|
||||
)
|
||||
else if (strcmp(s, "C") == 0 ||
|
||||
strcmp(s, "POSIX") == 0)
|
||||
ret = "US-ASCII";
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user