summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/eptexdir
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/texk/web2c/eptexdir
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/texk/web2c/eptexdir')
-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
3 files changed, 14 insertions, 4 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);