texlive[43720] Build/source/texk/web2c: (u)pTeX: bug fix on

commits+takuji at tug.org commits+takuji at tug.org
Sun Apr 9 10:15:01 CEST 2017


Revision: 43720
          http://tug.org/svn/texlive?view=revision&revision=43720
Author:   takuji
Date:     2017-04-09 10:15:00 +0200 (Sun, 09 Apr 2017)
Log Message:
-----------
(u)pTeX: bug fix on \endlinechar by Kitagawa-san

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/ptexdir/tests/endlinechar.tex

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2017-04-09 00:06:00 UTC (rev 43719)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2017-04-09 08:15:00 UTC (rev 43720)
@@ -1,3 +1,9 @@
+2017-04-09  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* ptex-base.ch: Fix a bug in single-letter control sequence
+	when \endlinechar=-1.
+	* tests/endlinechar.tex: Added.
+
 2017-04-06  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
 
 	* ptex-base.ch: Fix a bug that the postbreakpenalty sometimes reappears

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2017-04-09 00:06:00 UTC (rev 43719)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2017-04-09 08:15:00 UTC (rev 43720)
@@ -1711,7 +1711,11 @@
     sequence is found, adjust |cur_cs| and |loc|, and
     |goto found|@>
   else @<If an expanded code is present, reduce it and |goto start_cs|@>;
-  cur_cs:=single_base+buffer[loc]; incr(loc);
+  {single-letter control sequence}
+  if (cat=kanji)or(cat=kana) then
+    begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found;
+    end
+  else begin cur_cs:=single_base+buffer[loc]; incr(loc); end;
   end;
 found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs);
 if cur_cmd>=outer_call then check_outer_validity;

Added: trunk/Build/source/texk/web2c/ptexdir/tests/endlinechar.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/endlinechar.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/endlinechar.tex	2017-04-09 08:15:00 UTC (rev 43720)
@@ -0,0 +1,53 @@
+\font\x=ecrm1000 \x
+\parindent0pt\noautoxspacing
+\output{\shipout\box255}
+\def\あ{ア}
+\def\,{イ}
+
+1a\,
+% --> 1aイ
+
+2a\あ
+% --> 2aア
+
+\endlinechar=-1\relax
+
+3a\,
+% --> 3aイ
+% previous pTeX, upTeX: Undefined cs.
+
+4a\あ
+% --> 4aア
+% prev. pTeX: Undefined cs.
+
+5a,
+% prev. upTeX: byte-seq.
+
+6aあ
+% prev. upTeX: byte-seq.
+
+7a\^^e3^^81^^82b\^^e3^^81^^82
+% 2回エラーが出るが,これは正しい.
+
+% upTeX only tests
+\ifx\enablecjktoken\undefined
+\else
+  \catcode"E3=11\relax
+  \catcode"81=11\relax
+  \catcode"82=11\relax
+  8a\^^e3^^81^^82
+  % --> 8aア
+  \kcatcode`あ=15\relax
+  9a\あ
+  % == 9a\^^e3^^81^^82. --> 9aア
+  \def\^^e3^^81^^82{ウ}
+  10a\あ b\あ
+  % == 10a\^^e3^^81^^82 b\^^e3^^81^^82. --> 10aウbウ
+  \kcatcode12354=16\relax
+  11a\あ b\あ
+  % == 10a\^^e3^^81^^82 b\^^e3^^81^^82. --> 11aウbウ
+\fi
+
+\bye
+
+


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/endlinechar.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2017-04-09 00:06:00 UTC (rev 43719)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2017-04-09 08:15:00 UTC (rev 43720)
@@ -1,3 +1,8 @@
+2017-04-09  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* uptex-m.ch: Fix a bug on a UTF-8 sequence at end of a line
+	when \endlinechar=-1.
+
 2017-01-15  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* uptex-m.ch, kanji.c:

Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2017-04-09 00:06:00 UTC (rev 43719)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2017-04-09 08:15:00 UTC (rev 43720)
@@ -1,4 +1,4 @@
-% This is a change file for upTeX u1.21
+% This is a change file for upTeX u1.22
 % By Takuji Tanaka.
 %
 % (02/26/2007) TTK  upTeX u0.01
@@ -35,6 +35,7 @@
 % (12/29/2014) TTK  upTeX u1.20
 % (02/20/2016) TTK  upTeX u1.21
 % (01/15/2017) TTK  upTeX u1.22
+% (04/09/2017) TTK  Hironori Kitagawa fixed a bug in \endlinechar.
 
 @x upTeX: banner
   {printed when p\TeX\ starts}
@@ -390,11 +391,11 @@
     else reswitch: cur_cmd:=cat_code(cur_chr);
 @y
   begin
-    cur_chr:=fromBUFF(ustringcast(buffer), limit, loc);
+    cur_chr:=fromBUFF(ustringcast(buffer), limit+1, loc);
     cur_cmd:=kcat_code(kcatcodekey(cur_chr));
-    if (multistrlen(ustringcast(buffer), limit, loc)>1) and check_kcat_code(cur_cmd) then begin
+    if (multistrlen(ustringcast(buffer), limit+1, loc)>1) and check_kcat_code(cur_cmd) then begin
       if (cur_cmd=not_cjk) then cur_cmd:=other_kchar;
-      loc:=loc+multistrlen(ustringcast(buffer), limit, loc) end
+      loc:=loc+multistrlen(ustringcast(buffer), limit+1, loc) end
     else begin
       cur_chr:=buffer[loc]; incr(loc);
       reswitch: cur_cmd:=cat_code(cur_chr);
@@ -432,11 +433,11 @@
   if (cat=letter)or(cat=kanji)or(cat=kana) then state:=skip_blanks
 @y
 else  begin k:=loc;
-  cur_chr:=fromBUFF(ustringcast(buffer), limit, k);
+  cur_chr:=fromBUFF(ustringcast(buffer), limit+1, k);
   cat:=kcat_code(kcatcodekey(cur_chr));
-  if (multistrlen(ustringcast(buffer), limit, k)>1) and check_kcat_code(cat) then begin
+  if (multistrlen(ustringcast(buffer), limit+1, k)>1) and check_kcat_code(cat) then begin
     if (cat=not_cjk) then cat:=other_kchar;
-    k:=k+multistrlen(ustringcast(buffer), limit, k) end
+    k:=k+multistrlen(ustringcast(buffer), limit+1, k) end
   else begin {not multi-byte char}
     cur_chr:=buffer[k];
     cat:=cat_code(cur_chr);
@@ -453,6 +454,12 @@
 @z
 
 @x
+  if (cat=kanji)or(cat=kana) then
+ at y
+  if (cat=kanji)or(cat=kana)or(cat=hangul) then
+ at z
+
+ at x
 begin repeat cur_chr:=buffer[k]; incr(k);
   if multistrlen(ustringcast(buffer), limit+1, k-1)=2 then
     begin cat:=kcat_code(kcatcodekey(fromBUFF(ustringcast(buffer), limit+1, k-1))); incr(k);
@@ -460,11 +467,11 @@
   else cat:=cat_code(cur_chr);
 @y
 begin repeat
-  cur_chr:=fromBUFF(ustringcast(buffer), limit, k);
+  cur_chr:=fromBUFF(ustringcast(buffer), limit+1, k);
   cat:=kcat_code(kcatcodekey(cur_chr));
-  if (multistrlen(ustringcast(buffer), limit, k)>1) and check_kcat_code(cat) then begin
+  if (multistrlen(ustringcast(buffer), limit+1, k)>1) and check_kcat_code(cat) then begin
     if (cat=not_cjk) then cat:=other_kchar;
-    k:=k+multistrlen(ustringcast(buffer), limit, k) end
+    k:=k+multistrlen(ustringcast(buffer), limit+1, k) end
   else begin {not multi-byte char}
     cur_chr:=buffer[k];
     cat:=cat_code(cur_chr);



More information about the tex-live-commits mailing list