[Ttssh2-commit] [8446] DECFRA が正しく動かないのを修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 12月 20日 (金) 13:00:18 JST


Revision: 8446
          https://osdn.net/projects/ttssh2/scm/svn/commits/8446
Author:   doda
Date:     2019-12-20 13:00:18 +0900 (Fri, 20 Dec 2019)
Log Message:
-----------
DECFRA が正しく動かないのを修正

Modified Paths:
--------------
    trunk/teraterm/teraterm/buffer.c

Added Paths:
-----------
    trunk/tests/decfra.sh

-------------- next part --------------
Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2019-12-17 12:15:31 UTC (rev 8445)
+++ trunk/teraterm/teraterm/buffer.c	2019-12-20 04:00:18 UTC (rev 8446)
@@ -1551,7 +1551,7 @@
 		    ((AttrBuff[Ptr+XStart-1] & AttrKanji) != 0)) {
 			CodeBuff[Ptr+XStart-1] = 0x20;
 #if UNICODE_INTERNAL_BUFF
-			BuffSetChar(&CodeLineW[Ptr + XStart - 1], 0x20, 'H');
+			BuffSetChar(&CodeBuffW[Ptr + XStart - 1], 0x20, 'H');
 #endif
 			AttrBuff[Ptr+XStart-1] ^= AttrKanji;
 		}
@@ -1559,12 +1559,12 @@
 		    ((AttrBuff[Ptr+XStart+Cols-1] & AttrKanji) != 0)) {
 			CodeBuff[Ptr+XStart+Cols] = 0x20;
 #if UNICODE_INTERNAL_BUFF
-			BuffSetChar(&CodeLineW[Ptr + XStart + Cols], 0x20, 'H');
+			BuffSetChar(&CodeBuffW[Ptr + XStart + Cols], 0x20, 'H');
 #endif
 		}
 		memset(&(CodeBuff[Ptr+XStart]), ch, Cols);
 #if UNICODE_INTERNAL_BUFF
-		BuffSetChar(&CodeLineW[Ptr + XStart], 0x20, 'H');
+		memsetW(&(CodeBuffW[Ptr+XStart]), ch, Cols);
 #endif
 		memset(&(AttrBuff[Ptr+XStart]), CurCharAttr.Attr, Cols);
 		memset(&(AttrBuff2[Ptr+XStart]), CurCharAttr.Attr2, Cols);

Added: trunk/tests/decfra.sh
===================================================================
--- trunk/tests/decfra.sh	                        (rev 0)
+++ trunk/tests/decfra.sh	2019-12-20 04:00:18 UTC (rev 8446)
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+CSI() {
+  printf "\033[%s" "$1"
+}
+
+Col() {
+  CSI "$1G"
+}
+
+Pos() {
+  CSI "$1;$2H"
+}
+
+SGR() {
+  CSI "$1m"
+}
+
+DECFRA() {
+  CSI "$1;$2;$3;$4;$5\$x"
+}
+
+Clear() {
+  Pos 1 1
+  CSI 2J
+}
+
+InitScreen() {
+#  CSI "8;24;80t"
+  CSI '2*x'
+  Clear
+}
+
+B0="0;1;4"
+B1="0;32"
+B2="0;45"
+B3="0;38:5:49;48:5:67"
+
+b0=$(SGR $B0)
+b1=$(SGR $B1)
+b2=$(SGR $B2)
+b3=$(SGR $B3)
+
+C0="0;7"
+C1="0;36"
+C2="0;41"
+C3="0;38:5:93;48:5:49"
+
+c0=$(SGR $C0)
+c1=$(SGR $C1)
+c2=$(SGR $C2)
+c3=$(SGR $C3)
+
+R=$(SGR)
+
+InitScreen
+
+Pos 3 6
+SGR
+echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+
+Col 6
+SGR $B0
+echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+
+Col 6
+SGR $B1
+echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+
+Col 6
+SGR $B2
+echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+
+Col 6
+SGR $B3
+echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+
+Col 6
+SGR
+echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+
+echo
+
+SGR
+DECFRA 42 2 11 9 15
+
+SGR $C0
+DECFRA 45 2 21 9 25
+
+SGR $C1
+DECFRA 39 2 31 9 35
+
+SGR $C2
+DECFRA 46 2 41 9 45
+
+SGR $C3
+DECFRA 35 2 51 9 55
+
+SGR
+DECFRA 42 2 61 9 65
+
+cat <<_EoF_
+
+=== 正しい出力は以下 ===
+
+          *****     $c0-----$R     $c1'''''$R     $c2.....$R     $c3#####$R     $c4*****$R
+     %%%%%*****%%%%%$c0-----$R%%%%%$c1'''''$R%%%%%$c2.....$R%%%%%$c3#####$R%%%%%$c4*****$R%%%%%
+     $b0%%%%%$R*****$b0%%%%%$c0-----$b0%%%%%$c1'''''$b0%%%%%$c2.....$b0%%%%%$c3#####$b0%%%%%$R*****$b0%%%%%$R
+     $b1%%%%%$R*****$b1%%%%%$c0-----$b1%%%%%$c1'''''$b1%%%%%$c2.....$b1%%%%%$c3#####$b1%%%%%$R*****$b1%%%%%$R
+     $b2%%%%%$R*****$b2%%%%%$c0-----$b2%%%%%$c1'''''$b2%%%%%$c2.....$b2%%%%%$c3#####$b2%%%%%$R*****$b2%%%%%$R
+     $b3%%%%%$R*****$b3%%%%%$c0-----$b3%%%%%$c1'''''$b3%%%%%$c2.....$b3%%%%%$c3#####$b3%%%%%$R*****$b3%%%%%$R
+     %%%%%*****%%%%%$c0-----$R%%%%%$c1'''''$R%%%%%$c2.....$R%%%%%$c3#####$R%%%%%$c4*****$R%%%%%
+          *****     $c0-----$R     $c1'''''$R     $c2.....$R     $c3#####$R     $c4*****$R
+_EoF_
+
+CSI "1*x"
+echo


Property changes on: trunk/tests/decfra.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property


Ttssh2-commit メーリングリストの案内
Back to archive index