From f58fded086e14735547d650ff180805e3868c3f9 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Tue, 6 Sep 2016 12:36:06 +0000 Subject: ptexdir, eptexdir: Patch from H. Kitagawa git-svn-id: svn://tug.org/texlive/trunk@41998 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/ptexdir/ptex-base.ch | 40 +++++++++++++++++----------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'Build/source/texk/web2c/ptexdir/ptex-base.ch') diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch index f8ebc5d8dc7..a40aa7a78c3 100644 --- a/Build/source/texk/web2c/ptexdir/ptex-base.ch +++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch @@ -2008,22 +2008,24 @@ toks_register,assign_toks,def_family,set_font,def_font,def_jfont,def_tfont: @z @x [26.414] l.8373 - pTeX: +begin scan_char_num; if m=math_code_base then scanned_result(ho(math_code(cur_val)))(int_val) else if m255) then end; end; @y +procedure scan_ascii_num; +begin scan_int; +if (cur_val<0)or(cur_val>255) then + begin print_err("Bad character code"); +@.Bad character code@> + help2("A character number must be between 0 and 255.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; procedure scan_char_num; begin scan_int; if not is_char_ascii(cur_val) and not is_char_kanji(cur_val) then @@ -5819,11 +5830,10 @@ def_code: begin @; def_code: begin @; @; - p:=cur_chr; scan_char_num; - 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; + p:=cur_chr; + if p=kcat_code_base then + begin scan_char_num; p:=p+kcatcodekey(cur_val) end + else begin scan_ascii_num; p:=p+cur_val; end; scan_optional_equals; scan_int; if ((cur_valn) then begin print_err("Invalid code ("); print_int(cur_val); -- cgit v1.2.3