texlive[42954] Build/source/texk/web2c/uptexdir: upbibtex: fix bug on

commits+takuji at tug.org commits+takuji at tug.org
Sat Jan 14 16:10:11 CET 2017


Revision: 42954
          http://tug.org/svn/texlive?view=revision&revision=42954
Author:   takuji
Date:     2017-01-14 16:10:11 +0100 (Sat, 14 Jan 2017)
Log Message:
-----------
upbibtex: fix bug on substring$

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/kanji.h
    trunk/Build/source/texk/web2c/uptexdir/upbibtex.ch

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2017-01-14 10:18:37 UTC (rev 42953)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2017-01-14 15:10:11 UTC (rev 42954)
@@ -1,3 +1,7 @@
+2017-01-14  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+	* upbibtex.ch, kanji.h: Fix bug on "substring$".
+	Thanks to Takeda Shiro san.
+
 2016-12-16  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* upbibtex.ch, updvitype.ch, uppltotf.ch, uptftopl.ch:
@@ -130,7 +134,7 @@
 
 	* kanji.c (init_default_kanji): Set defaults before testing
 	PTEX_KANJI_ENC from the environment.
-	* kanji.c: All programs use init_default_kanji("utf8","uptex"). 
+	* kanji.c: All programs use init_default_kanji("utf8","uptex").
 
 2012-08-13  TANAKA Takuji  <KXD02663 at nifty.ne.jp>
 

Modified: trunk/Build/source/texk/web2c/uptexdir/kanji.h
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/kanji.h	2017-01-14 10:18:37 UTC (rev 42953)
+++ trunk/Build/source/texk/web2c/uptexdir/kanji.h	2017-01-14 15:10:11 UTC (rev 42954)
@@ -42,13 +42,8 @@
 extern integer multilenbuffchar (integer c);
 
 extern void init_default_kanji (const_string file_str, const_string internal_str);
-#ifdef UPBIBTEX
-/* for upBibTeX */
-#define initkanji() init_default_kanji("utf8", "euc")
-#else
-/* for upTeX, e-upTeX, upDVItype, upPLtoTF, and upTFtoPL */
+/* for upTeX, e-upTeX, upBibTeX, upDVItype, upPLtoTF, and upTFtoPL */
 #define initkanji() init_default_kanji("utf8", "uptex")
-#endif
 /* for upDVItype */
 #define setpriorfileenc() set_prior_file_enc()
 

Modified: trunk/Build/source/texk/web2c/uptexdir/upbibtex.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/upbibtex.ch	2017-01-14 10:18:37 UTC (rev 42953)
+++ trunk/Build/source/texk/web2c/uptexdir/upbibtex.ch	2017-01-14 15:10:11 UTC (rev 42954)
@@ -3,7 +3,7 @@
 @d banner=='This is pBibTeX, Version 0.99d-j0.33'
 @y
 @d my_name=='upbibtex'
- at d banner=='This is upBibTeX, Version 0.99d-j0.33-u1.21'
+ at d banner=='This is upBibTeX, Version 0.99d-j0.33-u1.22'
 @z
 
 @x
@@ -233,22 +233,60 @@
 
 @x
 { 2 bytes Kanji code break check }
- at y
-{ |2..4| bytes Kanji code break check }
- at z
- at x
+tps:=str_start[pop_lit3];
+while (tps < sp_ptr) do begin
     if str_pool[tps] > 127
     then tps := tps + 2
     else incr(tps);
- at y
-    tps := tps + multibytelen(str_pool[tps]);
- at z
- at x
+end;
+tpe:=tps;
+while (tpe < sp_end) do begin
     if str_pool[tpe] > 127
     then tpe := tpe+2
     else incr(tpe);
+end;
+if tps<>sp_ptr then begin
+    if tps>str_start[pop_lit3]
+    then decr(sp_ptr)
+    else incr(sp_ptr);
+end;
+if tpe<>sp_end then begin
+    if tpe<str_start[pop_lit3+1]
+    then incr(sp_end)
+    else decr(sp_end);
+end;
 @y
-    tpe := tpe + multibytelen(str_pool[tpe]);
+{ |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;
+end;
 @z
 
 @x
@@ -267,10 +305,7 @@
         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);
+    sp_ptr := sp_ptr + multibytelen(str_pool[sp_ptr])
 @z
 
 @x



More information about the tex-live-commits mailing list