diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-12-19 14:33:12 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-12-19 14:33:12 +0000 |
commit | b900237b52142fc387930db473e26d901673a414 (patch) | |
tree | f7ddfff9ba923d55fee6a8af6e3142a9f48bec87 /Build/source/texk/web2c/eptexdir/fam256.ch | |
parent | fbd50cdbd2c221a7f2a9f5bac3f4db0848763c64 (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/fam256.ch')
-rw-r--r-- | Build/source/texk/web2c/eptexdir/fam256.ch | 10 |
1 files changed, 8 insertions, 2 deletions
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); |