2016-11-25 10:48:06 +01:00
|
|
|
---
|
|
|
|
sh.c | 4 ++--
|
|
|
|
sh.func.c | 15 +++++++--------
|
|
|
|
sh.set.c | 14 ++++++++++----
|
|
|
|
tc.const.c | 4 +++-
|
|
|
|
4 files changed, 22 insertions(+), 15 deletions(-)
|
|
|
|
|
2011-11-17 11:34:10 +01:00
|
|
|
--- sh.c
|
2016-11-25 10:48:06 +01:00
|
|
|
+++ sh.c 2016-11-25 08:02:39.616478025 +0000
|
2019-12-02 09:28:24 +01:00
|
|
|
@@ -863,9 +863,9 @@ main(int argc, char **argv)
|
2011-11-17 11:34:10 +01:00
|
|
|
/* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
|
|
|
|
#if defined(DSPMBYTE)
|
|
|
|
#if defined(NLS) && defined(LC_CTYPE)
|
|
|
|
- if (((tcp = setlocale(LC_CTYPE, NULL)) != NULL || (tcp = getenv("LANG")) != NULL) && !adrof(CHECK_MBYTEVAR))
|
|
|
|
+ if (((tcp = setlocale(LC_CTYPE, NULL)) != NULL || (tcp = getenv("LANG")) != NULL))
|
|
|
|
#else
|
|
|
|
- if ((tcp = getenv("LANG")) != NULL && !adrof(CHECK_MBYTEVAR))
|
|
|
|
+ if ((tcp = getenv("LANG")) != NULL)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
autoset_dspmbyte(str2short(tcp));
|
|
|
|
--- sh.func.c
|
2016-11-25 10:48:06 +01:00
|
|
|
+++ sh.func.c 2016-11-25 08:02:39.616478025 +0000
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1420,14 +1420,6 @@ dosetenv(Char **v, struct command *c)
|
2011-11-17 11:34:10 +01:00
|
|
|
}
|
|
|
|
#endif /* apollo */
|
|
|
|
|
|
|
|
- /* dspkanji/dspmbyte autosetting */
|
|
|
|
- /* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
|
|
|
|
-#if defined(DSPMBYTE)
|
|
|
|
- if(eq(vp, STRLANG) && !adrof(CHECK_MBYTEVAR)) {
|
|
|
|
- autoset_dspmbyte(lp);
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
if (islocale_var(vp)) {
|
|
|
|
#ifdef NLS
|
|
|
|
int k;
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1452,6 +1444,13 @@ dosetenv(Char **v, struct command *c)
|
2011-11-17 11:34:10 +01:00
|
|
|
nlsclose();
|
|
|
|
nlsinit();
|
|
|
|
# endif /* NLS_CATALOGS */
|
|
|
|
+# if defined(DSPMBYTE)
|
|
|
|
+ /* dspkanji/dspmbyte autosetting */
|
|
|
|
+ /* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
|
|
|
|
+ if (eq(vp, STRLANG)) {
|
|
|
|
+ autoset_dspmbyte(lp);
|
|
|
|
+ }
|
|
|
|
+# endif
|
|
|
|
# ifdef SETLOCALEBUG
|
|
|
|
dont_free = 0;
|
|
|
|
# endif /* SETLOCALEBUG */
|
|
|
|
--- sh.set.c
|
2016-11-25 10:48:06 +01:00
|
|
|
+++ sh.set.c 2016-11-25 08:02:39.616478025 +0000
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1164,11 +1164,11 @@ update_dspmbyte_vars(void)
|
2011-11-17 11:34:10 +01:00
|
|
|
dstr1 = vp->vec[0];
|
|
|
|
if(eq (dstr1, STRsjis))
|
|
|
|
iskcode = 1;
|
|
|
|
- else if (eq(dstr1, STReuc))
|
|
|
|
+ else if (eq(dstr1, STReuc) || eq(dstr1, STReucjp) || eq(dstr1, STRGB2312))
|
|
|
|
iskcode = 2;
|
|
|
|
else if (eq(dstr1, STRbig5))
|
|
|
|
iskcode = 3;
|
|
|
|
- else if (eq(dstr1, STRutf8))
|
|
|
|
+ else if (eq(dstr1, STRutf8) || eq(dstr1, STRutfx8))
|
|
|
|
iskcode = 4;
|
|
|
|
else if ((dstr1[0] - '0') >= 0 && (dstr1[0] - '0') <= 3) {
|
|
|
|
iskcode = 0;
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1252,7 +1252,7 @@ update_dspmbyte_vars(void)
|
2011-11-17 11:34:10 +01:00
|
|
|
_enable_mbdisp = 0;
|
|
|
|
dspmbyte_ls = 0;
|
|
|
|
}
|
|
|
|
-#ifdef MBYTEDEBUG /* Sorry, use for beta testing */
|
|
|
|
+# ifdef MBYTEDEBUG /* Sorry, use for beta testing */
|
|
|
|
{
|
|
|
|
Char mbmapstr[300];
|
|
|
|
for (lp = 0; lp < 256; lp++)
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1260,7 +1260,7 @@ update_dspmbyte_vars(void)
|
2011-11-17 11:34:10 +01:00
|
|
|
mbmapstr[lp] = 0;
|
|
|
|
setcopy(STRmbytemap, mbmapstr, VAR_READWRITE);
|
|
|
|
}
|
|
|
|
-#endif /* MBYTEMAP */
|
|
|
|
+# endif /* MBYTEMAP */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* dspkanji/dspmbyte autosetting */
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1269,6 +1269,7 @@ void
|
2011-11-17 11:34:10 +01:00
|
|
|
autoset_dspmbyte(const Char *pcp)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
+ struct varent *vp;
|
|
|
|
static const struct dspm_autoset_Table {
|
|
|
|
Char *n;
|
|
|
|
Char *v;
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -1291,13 +1292,18 @@ autoset_dspmbyte(const Char *pcp)
|
2011-11-17 11:34:10 +01:00
|
|
|
#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
|
|
|
|
static const struct dspm_autoset_Table dspmc[] = {
|
|
|
|
{ STRstarutfstar8, STRutf8 },
|
|
|
|
+ { STRutfx8, STRutf8 },
|
|
|
|
{ STReuc, STReuc },
|
|
|
|
+ { STReucjp, STReuc },
|
|
|
|
{ STRGB2312, STReuc },
|
|
|
|
{ STRLANGBIG5, STRbig5 },
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
Char *codeset;
|
|
|
|
|
|
|
|
+ if ((vp = adrof(CHECK_MBYTEVAR)))
|
|
|
|
+ unsetv1(vp);
|
|
|
|
+
|
|
|
|
codeset = str2short(nl_langinfo(CODESET));
|
|
|
|
if (*codeset != '\0') {
|
|
|
|
for (i = 0; dspmc[i].n; i++) {
|
|
|
|
--- tc.const.c
|
2016-11-25 10:48:06 +01:00
|
|
|
+++ tc.const.c 2016-11-25 08:02:39.616478025 +0000
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -130,10 +130,12 @@ Char STRmmliteral[] = { '-', 'G', '\0' }
|
2011-11-17 11:34:10 +01:00
|
|
|
Char STRmmliteral[] = { '-', '-', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\0' };
|
|
|
|
# endif
|
|
|
|
Char STReuc[] = { 'e', 'u', 'c', '\0' };
|
|
|
|
+Char STReucjp[] = { 'e', 'u', 'c', '-', 'j', 'p', '\0' };
|
|
|
|
Char STRsjis[] = { 's', 'j', 'i', 's', '\0' };
|
|
|
|
Char STRbig5[] = { 'b', 'i', 'g', '5', '\0' };
|
|
|
|
Char STRutf8[] = { 'u', 't', 'f', '8', '\0' };
|
|
|
|
Char STRstarutfstar8[] = { '*', 'u', 't', 'f', '*', '8', '\0' };
|
|
|
|
+Char STRutfx8[] = { 'u', 't', 'f', '-', '8', '\0' };
|
|
|
|
Char STRGB2312[] = { 'g', 'b', '2', '3', '1', '2', '\0' };
|
|
|
|
# ifdef MBYTEDEBUG /* Sorry, use for beta testing */
|
|
|
|
Char STRmbytemap[] = { 'm', 'b', 'y', 't', 'e', 'm', 'a', 'p', '\0' };
|
2019-05-09 10:55:54 +02:00
|
|
|
@@ -440,7 +442,7 @@ Char STRkilldup[] = { 'k', 'i', 'l', 'l
|
2011-11-17 11:34:10 +01:00
|
|
|
Char STRshlvl[] = { 's', 'h', 'l', 'v', 'l', '\0' };
|
|
|
|
Char STRKSHLVL[] = { 'S', 'H', 'L', 'V', 'L', '\0' };
|
|
|
|
Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' };
|
|
|
|
-Char STRLC_ALL[] = { 'L', 'C', '_', 'A', 'L', 'L', '\0' };
|
|
|
|
+Char STRLC_ALL[] = { 'L', 'C', '_', 'A', 'L', 'L', '\0' };
|
|
|
|
Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E' ,'\0' };
|
|
|
|
Char STRLC_NUMERIC[] = { 'L', 'C', '_', 'N', 'U', 'M', 'E', 'R', 'I',
|
|
|
|
'C', '\0' };
|