billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=6e8faa30a762739bb07504134a20289eae8bb1bf

commit 6e8faa30a762739bb07504134a20289eae8bb1bf
Author: Boris Faure <[email protected]>
Date:   Sat Dec 29 15:19:31 2018 +0100

    termptyesc: refuse no value on decfra on the character to fill up + tests
---
 src/bin/termptyesc.c                               |  3 +-
 tests/decfi.sh                                     |  1 +
 ...fra-decera-default-values-no-restrict-cursor.sh | 38 +++++++++++++++++++
 ...decfra-decera-default-values-restrict-cursor.sh | 43 ++++++++++++++++++++++
 tests/tests.results                                |  2 +
 5 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 814f4e7..f4f5004 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1528,14 +1528,13 @@ _handle_esc_csi_decfra(Termpty *ty, Eina_Unicode **b)
    DBG("DECFRA (%d; %d;%d;%d;%d) Fill Rectangular Area",
        c, top, left, bottom, right);
    if ((c == -CSI_ARG_ERROR) ||
+       (c == -CSI_ARG_NO_VALUE) ||
        (top == -CSI_ARG_ERROR) ||
        (left == -CSI_ARG_ERROR) ||
        (bottom == -CSI_ARG_ERROR) ||
        (right == -CSI_ARG_ERROR))
      return;
 
-   /* TODO: -CSI_ARG_NO_VALUE */
-
    if (! ((c >= 32 && c <= 126) || (c >= 160 && c <= 255)))
      return;
 
diff --git a/tests/decfi.sh b/tests/decfi.sh
index bcad382..b26f488 100755
--- a/tests/decfi.sh
+++ b/tests/decfi.sh
@@ -68,6 +68,7 @@ done
 # move
 printf '\033[11;81H'
 # decfi, do nothing. Xterm seems change wrapping here. I don't see why
+# @xtermbug
 printf 'f\033\071g'
 
 # move
diff --git a/tests/decfra-decera-default-values-no-restrict-cursor.sh 
b/tests/decfra-decera-default-values-no-restrict-cursor.sh
new file mode 100755
index 0000000..06e8ee2
--- /dev/null
+++ b/tests/decfra-decera-default-values-no-restrict-cursor.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# move to 0; 0
+printf '\033[H'
+# fill space
+for _ in $(seq 0 23); do
+   for _ in $(seq 0 7); do
+      printf '\-/|\\~_>^<'
+   done
+done
+
+# move to 0; 0
+printf '\033[H'
+
+#set color
+printf '\033[46;31;3m'
+# set top/bottom margins:
+printf '\033[5;20r'
+# allow left/right margins
+printf '\033[?69h'
+# set left/right margins:
+printf '\033[5;74s'
+
+# DECFRA
+# fill inside rect with nothing
+printf '\033[;10;40;15;45\044x'
+# fill inside rect with invalid value
+printf '\033[30;10;40;15;45\044x'
+# top left corner
+printf '\033[64;;;10;10\044x'
+# bottom right corner
+printf '\033[64;17;70;;\044x'
+
+# DECERA
+# top right corner
+printf '\033[;70;10;\044z'
+# bottom left corner
+printf '\033[17;;;10\044z'
diff --git a/tests/decfra-decera-default-values-restrict-cursor.sh 
b/tests/decfra-decera-default-values-restrict-cursor.sh
new file mode 100755
index 0000000..dcdc203
--- /dev/null
+++ b/tests/decfra-decera-default-values-restrict-cursor.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# move to 0; 0
+printf '\033[H'
+# fill space
+for _ in $(seq 0 23); do
+   for _ in $(seq 0 7); do
+      printf '\-/|\\~_>^<'
+   done
+done
+
+# move to 0; 0
+printf '\033[H'
+
+#set color
+printf '\033[46;31;3m'
+# set top/bottom margins:
+printf '\033[2;23r'
+# allow left/right margins
+printf '\033[?69h'
+# set left/right margins:
+printf '\033[3;78s'
+
+# restrict cursor
+printf '\033[?6h'
+
+# DECFRA
+# fill inside rect with nothing
+printf '\033[;10;40;15;45\044x'
+# fill inside rect with invalid value
+printf '\033[30;10;40;15;45\044x'
+# top left corner
+# @xtermbug
+printf '\033[64;;;10;10\044x'
+# bottom right corner
+printf '\033[64;17;70;;\044x'
+
+# DECERA
+# top right corner
+printf '\033[;70;10;\044z'
+# bottom left corner
+# @xtermbug
+printf '\033[17;;;10\044z'
diff --git a/tests/tests.results b/tests/tests.results
index 5577705..f71bdb5 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -3,6 +3,8 @@ decfra-restrict-cursor.sh 0a595dc0088097dd235dd5c8801a3eb5
 decera-no-restrict-cursor.sh 9d33acf9eca6eed4192e6d7f5104d202
 decera-restrict-cursor.sh 89b15109e4e2ade943a2ab3990729931
 decera-decfra-extra.sh abfe90a1df148bf15e7bf0d56163c76a
+decfra-decera-default-values-restrict-cursor.sh 
9710ed6167f2127671dbab2d7dbeb1eb
+decfra-decera-default-values-no-restrict-cursor.sh 
6508b473da2de3127dd65da0abe0c877
 cursor-movements.sh 6b916da9bdb377e199bba69b1efefac6
 fonts.sh d0dcea18258b95d5c869aa866fcae10f
 cursor-shape-0.sh c91e01b0e859cc043f21d804a01bcd50

-- 


Reply via email to