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/uptexdir/uptex-m.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/uptexdir/uptex-m.ch')
-rw-r--r-- | Build/source/texk/web2c/uptexdir/uptex-m.ch | 50 |
1 files changed, 5 insertions, 45 deletions
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)); |