diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2018-09-16 05:36:36 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2018-09-16 05:36:36 +0000 |
commit | fa21808ee837ae75aa11594b38695b422fe272dd (patch) | |
tree | a503cd540bb51e34bd677b5d9fc1cf16667b4015 /Build/source/texk | |
parent | 505b6ff904d606d7d3a5e42c7a5da02962d3e358 (diff) |
upbibtex: Fix bug of substring$ (T. Sakai)
git-svn-id: svn://tug.org/texlive/trunk@48676 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/web2c/ptexdir/kanji.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/upbibtex.ch | 48 |
3 files changed, 19 insertions, 38 deletions
diff --git a/Build/source/texk/web2c/ptexdir/kanji.h b/Build/source/texk/web2c/ptexdir/kanji.h index 8b156130d9e..b8404c7f1f8 100644 --- a/Build/source/texk/web2c/ptexdir/kanji.h +++ b/Build/source/texk/web2c/ptexdir/kanji.h @@ -28,7 +28,7 @@ #define Hi(x) (((x) >> 8) & 0xff) #define Lo(x) ((x) & 0xff) -extern int check_kanji (integer c); +extern boolean check_kanji (integer c); #define checkkanji check_kanji extern boolean is_char_ascii (integer c); #define ischarascii is_char_ascii diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog index c2018364d86..8d1bb7cca2b 100644 --- a/Build/source/texk/web2c/uptexdir/ChangeLog +++ b/Build/source/texk/web2c/uptexdir/ChangeLog @@ -1,3 +1,10 @@ +2018-09-16 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * upbibtex.ch: Fix bug of substring$ + from Takashi Sakai: + https://github.com/texjporg/tex-jp-build/issues/64 + https://github.com/texjporg/tex-jp-build/pull/66 + 2018-09-09 Karl Berry <karl@tug.org> * uptriptest.test: LC_ALL=LANGUAGE=C. diff --git a/Build/source/texk/web2c/uptexdir/upbibtex.ch b/Build/source/texk/web2c/uptexdir/upbibtex.ch index d0a5bc4d10d..c29f46049d9 100644 --- a/Build/source/texk/web2c/uptexdir/upbibtex.ch +++ b/Build/source/texk/web2c/uptexdir/upbibtex.ch @@ -258,35 +258,18 @@ end; @y { |2..4| bytes Kanji code break check } tps:=str_start[pop_lit3]; -while (tps < sp_ptr) do begin - tps := tps + multibytelen(str_pool[tps]) -end; tpe:=tps; -while (tpe < sp_end) do begin - tpe := tpe + multibytelen(str_pool[tpe]) -end; -if tps<>sp_ptr then begin - if (is_internalUPTEX) then begin - if tps>str_start[pop_lit3] - then while (multibytelen(str_pool[sp_ptr])<0) do decr(sp_ptr) - else while (multibytelen(str_pool[sp_ptr])<0) do incr(sp_ptr) - end else begin - if tps>str_start[pop_lit3] - then decr(sp_ptr) - else incr(sp_ptr) - end; -end; -if tpe<>sp_end then begin - if (is_internalUPTEX) then begin - if tpe<str_start[pop_lit3+1] - then while (multibytelen(str_pool[sp_end])<0) do incr(sp_end) - else while (multibytelen(str_pool[sp_end])<0) do decr(sp_end) - end else begin - if tpe<str_start[pop_lit3+1] - then incr(sp_end) - else decr(sp_end) - end; +while tpe < str_start[pop_lit3+1] do begin + if multibytelen(str_pool[tpe])<0 + or (str_start[pop_lit3+1] < tpe+multibytelen(str_pool[tpe])) then + break; + tpe := tpe + multibytelen(str_pool[tpe]); + if tpe<=sp_ptr then + tps := tpe; + if sp_end<=tpe then break; end; +sp_ptr := tps; +sp_end := tpe; @z @x @@ -299,16 +282,7 @@ end; end; @y append_char (str_pool[sp_ptr]); - if multibytelen(str_pool[sp_ptr]) > 1 then - append_char (str_pool[sp_ptr+1]); - if multibytelen(str_pool[sp_ptr]) > 2 then - append_char (str_pool[sp_ptr+2]); - if multibytelen(str_pool[sp_ptr]) > 3 then - append_char (str_pool[sp_ptr+3]); - if multibytelen(str_pool[sp_ptr]) > 0 then - sp_ptr := sp_ptr + multibytelen(str_pool[sp_ptr]) - else - incr(sp_ptr); + incr(sp_ptr); @z @x |