[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61417] [tbl] core dump when further spanning a first-row (invalid)

From: G. Branden Robinson
Subject: [bug #61417] [tbl] core dump when further spanning a first-row (invalid) downward span
Date: Wed, 3 Nov 2021 14:01:00 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Update of bug #61417 (project groff):

                  Status:                    None => In Progress            
             Assigned to:                    None => gbranden               


Follow-up Comment #1:

Proposed patch.

This was plainly an oversight in the original implementation; dealing with an
invalid vertical span while reading a table format specification is a
different beast than dealing with it while reading table data--you have to do
_something_ with the place where the entry should go.  Happily, I don't even
have to give up on the table.

diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 11950f1de..06774b899 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1534,7 +1534,12 @@ void table::add_entry(int r, int c, const string &str,
       e = new double_line_entry(this, f);
   else if (str == "\\^") {
-    do_vspan(r, c);
+    if (r == 0) {
+      error("first row cannot contain a vertical span entry '\\^'");
+      e = new empty_entry(this, f);
+    }
+    else
+      do_vspan(r, c);
   else if (str.length() > 2 && str[0] == '\\' && str[1] == 'R') {
     if (str.search('\n') >= 0)

GNU tbl soldiers on nicely now.

$ cat EXPERIMENTS/table-span-down.ms
l l l.
foo     \^      bar
baz     \^      qux
$ tgu -t -ms EXPERIMENTS/table-span-down.ms | cat -s
tbl:EXPERIMENTS/table-span-down.ms:4: error: first row cannot contain a
vertical span entry '\^'

foo       bar
baz       qux


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]