summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-12-19 14:33:12 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-12-19 14:33:12 +0000
commitb900237b52142fc387930db473e26d901673a414 (patch)
treef7ddfff9ba923d55fee6a8af6e3142a9f48bec87 /Build/source
parentfbd50cdbd2c221a7f2a9f5bac3f4db0848763c64 (diff)
(e-)(u)pTeX: Avoid Segmentation fault for japanese \catcode or \kcatcode
Patch from Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> git-svn-id: svn://tug.org/texlive/trunk@24874 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/eptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.defines3
-rw-r--r--Build/source/texk/web2c/eptexdir/fam256.ch10
-rw-r--r--Build/source/texk/web2c/euptexdir/ChangeLog9
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.ch12
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.defines3
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/ptexdir/kanji.c19
-rw-r--r--Build/source/texk/web2c/ptexdir/kanji.h6
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch52
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex.defines3
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog10
-rw-r--r--Build/source/texk/web2c/uptexdir/kanji.c36
-rw-r--r--Build/source/texk/web2c/uptexdir/kanji.h8
-rw-r--r--Build/source/texk/web2c/uptexdir/uppltotf.ch2
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex-m.ch50
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex.defines3
-rw-r--r--Build/source/texk/web2c/uptexdir/uptftopl.ch2
18 files changed, 114 insertions, 114 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog
index 49ea34c5d66..17ac2151cdb 100644
--- a/Build/source/texk/web2c/eptexdir/ChangeLog
+++ b/Build/source/texk/web2c/eptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-19 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * fam256.ch, eptex.defines: Avoid Segmentation fault for
+ japanese \catcode or \kcatcode.
+
2011-09-30 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/eptex.am (eptexdir/ptex_version.h): Fix a typo.
diff --git a/Build/source/texk/web2c/eptexdir/eptex.defines b/Build/source/texk/web2c/eptexdir/eptex.defines
index e1c1ee2756a..96799d312ee 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.defines
+++ b/Build/source/texk/web2c/eptexdir/eptex.defines
@@ -27,9 +27,8 @@
@define function toUCS ();
@define function checkkanji ();
-@define function iskanji ();
@define function ischarascii ();
-@define function iswcharascii ();
+@define function ischarkanji ();
@define function ismultiprn ();
@define function calcpos ();
@define function kcatcodekey ();
diff --git a/Build/source/texk/web2c/eptexdir/fam256.ch b/Build/source/texk/web2c/eptexdir/fam256.ch
index d4db07b3499..e796207c686 100644
--- a/Build/source/texk/web2c/eptexdir/fam256.ch
+++ b/Build/source/texk/web2c/eptexdir/fam256.ch
@@ -1160,7 +1160,10 @@ def_code: begin
@<Let |m| be the minimal legal code value, based on |cur_chr|@>;
@<Let |n| be the largest legal code value, based on |cur_chr|@>;
p:=cur_chr; scan_char_num;
- if p=kcat_code_base then p:=p+kcatcodekey(cur_val) else p:=p+cur_val;
+ if p=kcat_code_base then p:=p+kcatcodekey(cur_val)
+ else if not is_char_ascii(cur_val) then p:=p+Hi(cur_val)
+ { If |cur_val| is a KANJI code, we use its upper half, as the case of retrieving. }
+ else p:=p+cur_val;
scan_optional_equals; scan_int;
if ((cur_val<m)and(p<del_code_base))or(cur_val>n) then
begin print_err("Invalid code ("); print_int(cur_val);
@@ -1205,7 +1208,10 @@ def_code: begin
@<Let |m| be the minimal legal code value, based on |cur_chr|@>;
@<Let |n| be the largest legal code value, based on |cur_chr|@>;
p:=cur_chr; cur_val1:=p; scan_char_num;
- if p=kcat_code_base then p:=p+kcatcodekey(cur_val) else p:=p+cur_val;
+ if p=kcat_code_base then p:=p+kcatcodekey(cur_val)
+ else if not is_char_ascii(cur_val) then p:=p+Hi(cur_val)
+ { If |cur_val| is a KANJI code, we use its upper half, as the case of retrieving. }
+ else p:=p+cur_val;
scan_optional_equals; scan_int;
if ((cur_val<m)and(p<del_code_base))or(cur_val>n) then
begin print_err("Invalid code ("); print_int(cur_val);
diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog
index 45d39060765..446a60a330a 100644
--- a/Build/source/texk/web2c/euptexdir/ChangeLog
+++ b/Build/source/texk/web2c/euptexdir/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * euptex.ch1: Drop unused param2 of check_kanji().
+
+2011-12-19 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * euptex.ch1, euptex.defines: Avoid Segmentation fault for
+ japanese \catcode or \kcatcode.
+
2011-08-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* euptex.defines: Remove setptexencuptex.
diff --git a/Build/source/texk/web2c/euptexdir/euptex.ch1 b/Build/source/texk/web2c/euptexdir/euptex.ch1
index 1a2039cb62d..e939c20772a 100644
--- a/Build/source/texk/web2c/euptexdir/euptex.ch1
+++ b/Build/source/texk/web2c/euptexdir/euptex.ch1
@@ -7,12 +7,10 @@
@z
@x e-pTeX: ifcsname l.28620
- if check_kanji(info(p)) then {|wchar_token|}
begin buffer[m]:=Hi(info(p)); incr(m);
end;
buffer[m]:=Lo(info(p)); incr(m); p:=link(p);
@y
- if check_kanji(info(p),4)=2 then {|wchar_token|}
begin
if BYTE1(toBUFF(info(p) mod max_cjk_val))<>0 then begin buffer[m]:=BYTE1(toBUFF(info(p) mod max_cjk_val)); incr(m); end;
if BYTE2(toBUFF(info(p) mod max_cjk_val))<>0 then begin buffer[m]:=BYTE2(toBUFF(info(p) mod max_cjk_val)); incr(m); end;
diff --git a/Build/source/texk/web2c/euptexdir/euptex.defines b/Build/source/texk/web2c/euptexdir/euptex.defines
index c888699960f..06198cc252d 100644
--- a/Build/source/texk/web2c/euptexdir/euptex.defines
+++ b/Build/source/texk/web2c/euptexdir/euptex.defines
@@ -33,9 +33,8 @@
@define function toUCS ();
@define function checkkanji ();
-@define function iskanji ();
@define function ischarascii ();
-@define function iswcharascii ();
+@define function ischarkanji ();
@define function ismultiprn ();
@define function calcpos ();
@define function kcatcodekey ();
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index d93aa045c0d..3eb1be48e42 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-19 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * ptex-base.ch, ptex.defines, kanji.[ch]: Avoid Segmentation
+ fault for japanese \catcode or \kcatcode.
+
2011-12-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptex-base.ch: Ensure that `hi(#)==#'.
diff --git a/Build/source/texk/web2c/ptexdir/kanji.c b/Build/source/texk/web2c/ptexdir/kanji.c
index d0a3766c25f..ac1769085e7 100644
--- a/Build/source/texk/web2c/ptexdir/kanji.c
+++ b/Build/source/texk/web2c/ptexdir/kanji.c
@@ -1,6 +1,6 @@
/*
* KANJI Code conversion routines.
- * (for ptex only)
+ * (for pTeX and e-pTeX)
*/
#include "kanji.h"
@@ -9,17 +9,10 @@
int sjisterminal;
#endif
-int check_kanji(integer c)
+/* TOKEN */
+boolean check_kanji(integer c)
{
- /* FIXME: why not 255 (0xff) */
- if (0 <= c && c <= 256) return -1; /* ascii without catcode */
- if (iskanji1(Hi(c)) && iskanji2(Lo(c))) return 1;
- return 0; /* ascii with catcode */
-}
-
-boolean is_kanji(integer c)
-{
- return (iskanji1(Hi(c)) && iskanji2(Lo(c)));
+ return is_char_kanji(c);
}
boolean is_char_ascii(integer c)
@@ -27,9 +20,9 @@ boolean is_char_ascii(integer c)
return (0 <= c && c < 0x100);
}
-boolean is_wchar_ascii(integer c)
+boolean is_char_kanji(integer c)
{
- return (!is_char_ascii(c) && !is_kanji(c));
+ return (iskanji1(Hi(c)) && iskanji2(Lo(c)));
}
boolean ismultiprn(integer c)
diff --git a/Build/source/texk/web2c/ptexdir/kanji.h b/Build/source/texk/web2c/ptexdir/kanji.h
index 5d33b97d9fa..1be8729cf3c 100644
--- a/Build/source/texk/web2c/ptexdir/kanji.h
+++ b/Build/source/texk/web2c/ptexdir/kanji.h
@@ -23,12 +23,10 @@ extern int sjisterminal;
extern int check_kanji (integer c);
#define checkkanji check_kanji
-extern boolean is_kanji (integer c);
-#define iskanji is_kanji
extern boolean is_char_ascii (integer c);
#define ischarascii is_char_ascii
-extern boolean is_wchar_ascii (integer c);
-#define iswcharascii is_wchar_ascii
+extern boolean is_char_kanji (integer c);
+#define ischarkanji is_char_kanji
extern boolean ismultiprn (integer c);
extern integer calc_pos (integer c);
#define calcpos calc_pos
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 569018c2946..759e4b5bbd0 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -1194,6 +1194,35 @@ for k:="A" to "Z" do
{ $\.{@@"20}+|k| = |kcatcodekey|(|fromKUTEN|(|HILO|(k,1))$ }
@z
+@x
+@ @<Show the halfword code in |eqtb[n]|@>=
+if n<math_code_base then
+ begin if n<lc_code_base then
+ begin print_esc("catcode"); print_int(n-cat_code_base);
+ end
+@y
+@ @<Show the halfword code in |eqtb[n]|@>=
+if n<math_code_base then
+ begin if n<kcat_code_base then
+ begin print_esc("catcode"); print_int(n-cat_code_base);
+ end
+ else if n<auto_xsp_code_base then
+ begin print_esc("kcatcode"); print_int(n-kcat_code_base);
+ end
+ else if n<inhibit_xsp_code_base then
+ begin print_esc("xspcode"); print_int(n-auto_xsp_code_base);
+ end
+ else if n<kinsoku_base then
+ begin print("(inhibitxspcode table) "); print_int(n-inhibit_xsp_code_base);
+ end
+ else if n<kansuji_base then
+ begin print("(kinsoku table) "); print_int(n-kinsoku_base);
+ end
+ else if n<lc_code_base then
+ begin print_esc("kansujichar"); print_int(n-kansuji_base);
+ end
+@z
+
@x [17.236] l.5092 - pTeX: cur_jfam_code, jchr_widow_penalty
@d cur_fam_code=44 {current family}
@d escape_char_code=45 {escape character for token output}
@@ -1965,12 +1994,16 @@ else scanned_result(eqtb[m+cur_val].int)(int_val);
@y
if m=math_code_base then scanned_result(ho(math_code(cur_val)))(int_val)
else if m=kcat_code_base then scanned_result(equiv(m+kcatcodekey(cur_val)))(int_val)
-else if m<math_code_base then
- begin if is_kanji(cur_val) then
+else if m<math_code_base then { \.{\\lccode}, \.{\\uccode}, \.{\\sfcode}, \.{\\catcode} }
+ begin if not is_char_ascii(cur_val) then
scanned_result(equiv(m+Hi(cur_val)))(int_val)
else scanned_result(equiv(m+cur_val))(int_val)
end
-else scanned_result(eqtb[m+cur_val].int)(int_val);
+else { \.{\\delcode} }
+ begin if not is_char_ascii(cur_val) then
+ scanned_result(eqtb[m+Hi(cur_val)].int)(int_val)
+ else scanned_result(eqtb[m+cur_val].int)(int_val)
+ end;
@z
@x [26.420] l.8474 - pTeX: Fetch a box dimension: dir_node
@@ -2069,7 +2102,7 @@ end;
@y
procedure scan_char_num;
begin scan_int;
-if not is_char_ascii(cur_val)and not check_kanji(cur_val) then {|wchar_token|}
+if not is_char_ascii(cur_val) and not is_char_kanji(cur_val) then
begin print_err("Bad character code");
@.Bad character code@>
help2("A character number must be between 0 and 255, or KANJI code.")@/
@@ -5626,7 +5659,10 @@ def_code: begin
@<Let |m| be the minimal legal code value, based on |cur_chr|@>;
@<Let |n| be the largest legal code value, based on |cur_chr|@>;
p:=cur_chr; scan_char_num;
- if p=kcat_code_base then p:=p+kcatcodekey(cur_val) else p:=p+cur_val;
+ if p=kcat_code_base then p:=p+kcatcodekey(cur_val)
+ else if not is_char_ascii(cur_val) then p:=p+Hi(cur_val)
+ { If |cur_val| is a KANJI code, we use its upper half, as the case of retrieving. }
+ else p:=p+cur_val;
scan_optional_equals; scan_int;
if ((cur_val<m)and(p<del_code_base))or(cur_val>n) then
begin print_err("Invalid code ("); print_int(cur_val);
@@ -5913,7 +5949,7 @@ set_kansuji_char: print_esc("kansujichar");
@ @<Assignments@>=
set_kansuji_char:
begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if not check_kanji(cur_val) then
+if not is_char_kanji(cur_val) then
begin print_err("Invalid KANSUJI char (");
print_hex(cur_val); print_char(")");
@.Invalid KANSUJI char@>
@@ -6049,7 +6085,7 @@ end;
@ @<Assignments@>=
assign_inhibit_xsp_code:
begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if check_kanji(n) then
+if is_char_kanji(n) then
begin j:=get_inhibit_pos(tokanji(n),new_pos);
if j=no_entry then
begin print_err("Inhibit table is full!!");
@@ -6123,7 +6159,7 @@ end;
@ @<Assignments@>=
assign_kinsoku:
begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if is_char_ascii(n) or check_kanji(n) then
+if is_char_ascii(n) or is_char_kanji(n) then
begin j:=get_kinsoku_pos(tokanji(n),new_pos);
if j=no_entry then
begin print_err("KINSOKU table is full!!");
diff --git a/Build/source/texk/web2c/ptexdir/ptex.defines b/Build/source/texk/web2c/ptexdir/ptex.defines
index b7680c84c7c..b8729a1839b 100644
--- a/Build/source/texk/web2c/ptexdir/ptex.defines
+++ b/Build/source/texk/web2c/ptexdir/ptex.defines
@@ -21,9 +21,8 @@
@define function fromKUTEN ();
@define function checkkanji ();
-@define function iskanji ();
@define function ischarascii ();
-@define function iswcharascii ();
+@define function ischarkanji ();
@define function ismultiprn ();
@define function calcpos ();
@define function kcatcodekey ();
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index 99b5ffb9fc8..b8cbfe38918 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,13 @@
+2011-12-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * uptex-m.ch, kanji.[ch]: Drop unused param2 of check_kanji().
+
+2011-12-19 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * uptex-m.ch, uptex.defines, kanji.[ch], uppltotf.ch,
+ uppltotf.ch: Avoid Segmentation fault for japanese \catcode
+ or \kcatcode.
+
2011-12-04 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* uptex-m.ch: change min_halfword because the ConTeXt with
diff --git a/Build/source/texk/web2c/uptexdir/kanji.c b/Build/source/texk/web2c/uptexdir/kanji.c
index 36ffdc22db5..62ea30f1805 100644
--- a/Build/source/texk/web2c/uptexdir/kanji.c
+++ b/Build/source/texk/web2c/uptexdir/kanji.c
@@ -1,6 +1,6 @@
/*
* KANJI Code conversion routines.
- * (for ptex only)
+ * (for upTeX and e-upTeX)
*/
#include "kanji.h"
@@ -15,29 +15,12 @@
int sjisterminal;
#endif
-/* m: for debug */
-integer check_kanji (integer c,integer m)
+/* TOKEN */
+boolean check_kanji (integer c)
{
- if (c > CS_TOKEN_FLAG) return 0;
- if (is_internalUPTEX()) {
- if ((c & CJK_TOKEN_FLAG) < CJK_CHAR_LIMIT) {
- if (XXHi(c)==0) return 1;
- else if (XXHi(c)>=KCAT_KANJI && XXHi(c)<=KCAT_HANGUL) return 2;
- }
- } else {
- if ((XHi(c)==0) &&
- iskanji1(Hi(c)) && iskanji2(Lo(c))) {
- if (XXHi(c)==0) return 1;
- else if (XXHi(c)>=KCAT_KANJI && XXHi(c)<=KCAT_HANGUL) return 2;
- }
- }
- if (0 <= c && c <= 255) return -1; /* ascii without catcode */
- return 0; /* ascii with catcode */
-}
-
-boolean is_kanji(integer c)
-{
- return (iskanji1(Hi(c)) && iskanji2(Lo(c)));
+ if (c > CS_TOKEN_FLAG) return false;
+ else if (!(XXHi(c)>=KCAT_KANJI && XXHi(c)<=KCAT_HANGUL)) return false;
+ else return is_char_kanji(c);
}
boolean is_char_ascii(integer c)
@@ -45,9 +28,12 @@ boolean is_char_ascii(integer c)
return (0 <= c && c < 0x100);
}
-boolean is_wchar_ascii(integer c)
+boolean is_char_kanji(integer c)
{
- return (!is_char_ascii(c) && !is_kanji(c));
+ if (is_internalUPTEX())
+ return (c>=0&&(c & CJK_TOKEN_FLAG) < CJK_CHAR_LIMIT);
+ else
+ return iskanji1(Hi(c)) && iskanji2(Lo(c));
}
boolean ismultiprn(integer c)
diff --git a/Build/source/texk/web2c/uptexdir/kanji.h b/Build/source/texk/web2c/uptexdir/kanji.h
index 76e577bdd0a..a6e92c40760 100644
--- a/Build/source/texk/web2c/uptexdir/kanji.h
+++ b/Build/source/texk/web2c/uptexdir/kanji.h
@@ -23,14 +23,12 @@ extern int sjisterminal;
#define Hi(x) BYTE3(x)
#define Lo(x) BYTE4(x)
-extern integer check_kanji (integer c, integer m);
+extern boolean check_kanji (integer c);
#define checkkanji check_kanji
-extern boolean is_kanji (integer c);
-#define iskanji is_kanji
extern boolean is_char_ascii (integer c);
#define ischarascii is_char_ascii
-extern boolean is_wchar_ascii (integer c);
-#define iswcharascii is_wchar_ascii
+extern boolean is_char_kanji (integer c);
+#define ischarkanji is_char_kanji
extern boolean ismultiprn (integer c);
extern integer calc_pos (integer c);
#define calcpos calc_pos
diff --git a/Build/source/texk/web2c/uptexdir/uppltotf.ch b/Build/source/texk/web2c/uptexdir/uppltotf.ch
index 61326987d0a..acaf3d45475 100644
--- a/Build/source/texk/web2c/uptexdir/uppltotf.ch
+++ b/Build/source/texk/web2c/uptexdir/uppltotf.ch
@@ -46,7 +46,7 @@ if (first_byte<@"21)
if (second_byte<@"21)or(second_byte>@"7E) then valid_jis_code:=false;
@y
begin valid_jis_code:=true;
-if (cx>@"FFFF)or(check_kanji(fromDVI(cx),0)<>1)
+if (cx>@"FFFF)or(not is_char_kanji(fromDVI(cx)))
or(toDVI(fromDVI(cx))<>cx) then valid_jis_code:=false;
@z
diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch
index ce5f134d455..71c57cffec4 100644
--- a/Build/source/texk/web2c/uptexdir/uptex-m.ch
+++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch
@@ -306,7 +306,7 @@ token that stands for a control sequence; is a multiple of~256, less~1}
end
else begin m:=Hi(info(p)); c:=Lo(info(p));
@y
- if check_kanji(info(p),1)=2 then {|wchar_token|}
+ if check_kanji(info(p)) then {|wchar_token|}
begin m:=info(p) div max_cjk_val; c:=info(p) mod max_cjk_val; end
else begin m:=info(p) div max_char_val; c:=info(p) mod max_char_val;
@z
@@ -354,7 +354,7 @@ if ((kcp mod @'10)>0)and(nrestmultichr(kcp)>0) then p:=p-(kcp mod @'10);
begin cur_input:=input_stack[base_ptr-1];
s:=get_avail; info(s):=Lo(buffer[loc]);
@y
- begin if (link(start)=null)and(check_kanji(info(start),2)=2) then {|wchar_token|}
+ begin if (link(start)=null)and(check_kanji(info(start))) then {|wchar_token|}
begin cur_input:=input_stack[base_ptr-1];
s:=get_avail; info(s):=(buffer[loc] mod max_char_val);
@z
@@ -470,7 +470,7 @@ if cat=other_kchar then k:=k-multilenbuffchar(cur_chr)+1; {now |k| points to fir
else
begin cur_cmd:=Hi(t); cur_chr:=Lo(t);
@y
- else if check_kanji(t,3)=2 then {|wchar_token|}
+ else if check_kanji(t) then {|wchar_token|}
begin cur_cmd:=t div max_cjk_val; cur_chr:=t mod max_cjk_val; end
else
begin cur_cmd:=t div max_char_val; cur_chr:=t mod max_char_val;
@@ -492,7 +492,7 @@ if cat=other_kchar then k:=k-multilenbuffchar(cur_chr)+1; {now |k| points to fir
end;
buffer[j]:=Lo(info(p)); incr(j); p:=link(p);
@y
- if check_kanji(info(p),4)=2 then {|wchar_token|}
+ if check_kanji(info(p)) then {|wchar_token|}
begin t:=toBUFF(info(p) mod max_cjk_val);
if BYTE1(t)<>0 then begin buffer[j]:=BYTE1(t); incr(j); end;
if BYTE2(t)<>0 then begin buffer[j]:=BYTE2(t); incr(j); end;
@@ -533,18 +533,6 @@ char_given,math_given: scanned_result(cur_chr)(int_val);
@z
@x
- begin if is_kanji(cur_val) then
-@y
- begin if (cur_val<0)or(cur_val>255) then
-@z
-
-@x
-if not is_char_ascii(cur_val)and not check_kanji(cur_val) then {|wchar_token|}
-@y
-if ((cur_val<0)or(cur_val>255))and(check_kanji(cur_val,6)<>1) then {|wchar_token|}
-@z
-
-@x
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|}
@y
if (cur_cmd>=kanji)and(cur_cmd<=hangul) then {|wchar_token|}
@@ -1000,7 +988,7 @@ if (t<cs_token_flag+single_base)and(not check_kanji(t)) then
@y
@<Change the case of the token in |p|, if a change is appropriate@>=
t:=info(p);
-if (t<cs_token_flag+single_base)and(check_kanji(t,7)<2) then
+if (t<cs_token_flag+single_base)and(not check_kanji(t)) then
begin c:=t mod max_char_val;
@z
@@ -1019,14 +1007,6 @@ undump_kanji(fmt_file);
@z
@x
-begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if not check_kanji(cur_val) then
-@y
-begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if check_kanji(cur_val,8)<>1 then
-@z
-
-@x
@d set_auto_xspacing_code=3
@y
@d set_auto_xspacing_code=3
@@ -1074,26 +1054,6 @@ set_enable_cjk_token: define(enable_cjk_token_code,data,cur_chr);
@z
@x
-assign_inhibit_xsp_code:
-begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if check_kanji(n) then
-@y
-assign_inhibit_xsp_code:
-begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if check_kanji(n,9)=1 then
-@z
-
-@x
-assign_kinsoku:
-begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if is_char_ascii(n) or check_kanji(n) then
-@y
-assign_kinsoku:
-begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if abs(check_kanji(n,10))=1 then
-@z
-
-@x
@ @<Insert a space around the character |p|@>=
if font_dir[font(p)]<>dir_default then
begin KANJI(cx):=info(link(p));
diff --git a/Build/source/texk/web2c/uptexdir/uptex.defines b/Build/source/texk/web2c/uptexdir/uptex.defines
index 9871d4a15e0..28b644e35ff 100644
--- a/Build/source/texk/web2c/uptexdir/uptex.defines
+++ b/Build/source/texk/web2c/uptexdir/uptex.defines
@@ -33,9 +33,8 @@
@define function fromUCS ();
@define function checkkanji ();
-@define function iskanji ();
@define function ischarascii ();
-@define function iswcharascii ();
+@define function ischarkanji ();
@define function ismultiprn ();
@define function calcpos ();
@define function kcatcodekey ();
diff --git a/Build/source/texk/web2c/uptexdir/uptftopl.ch b/Build/source/texk/web2c/uptexdir/uptftopl.ch
index 00ad96fe5f5..25fda2700b1 100644
--- a/Build/source/texk/web2c/uptexdir/uptftopl.ch
+++ b/Build/source/texk/web2c/uptexdir/uptftopl.ch
@@ -57,7 +57,7 @@ if (first_byte<@"21)
if (second_byte<@"21)or(second_byte>@"7E) then valid_jis_code:=false;
@y
begin valid_jis_code:=true;
-if (cx>@"FFFF)or(check_kanji(fromDVI(cx),0)<>1)
+if (cx>@"FFFF)or(not is_char_kanji(fromDVI(cx)))
or(toDVI(fromDVI(cx))<>cx) then valid_jis_code:=false;
@z