groff-commit
[Top][All Lists]
Advanced

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

[groff] 21/41: [tbl]: Fix Savannah #62191.


From: G. Branden Robinson
Subject: [groff] 21/41: [tbl]: Fix Savannah #62191.
Date: Fri, 18 Mar 2022 00:41:30 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 0bbdd18872efc3aeaf028740c98ddc1d68b0524e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Mar 16 19:32:39 2022 +1100

    [tbl]: Fix Savannah #62191.
    
    * src/preproc/tbl/main.cpp (table_input::get): Increment input line
      counter when encountering an escaped newline; this fixes inaccurate
      diagnostics from the formatter at any point in a document after a
      line-continued row of table data.  Also drop a "perhaps" comment.  I
      tested the surmise (setting the FSM state to "START"), and it results
      in bad formatting.
    
    Fixes <https://savannah.gnu.org/bugs/?62191>.  Problem appears to date
    back to groff 1.02 (June 1991) at the latest.
---
 ChangeLog                | 14 ++++++++++++++
 src/preproc/tbl/main.cpp |  6 ++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 18cc4236..a81ff80d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2022-03-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [tbl]: Fix Savannah #62191.
+
+       * src/preproc/tbl/main.cpp (table_input::get): Increment input
+       line counter when encountering an escaped newline; this fixes
+       inaccurate diagnostics from the formatter at any point in a
+       document after a line-continued row of table data.  Also drop a
+       "perhaps" comment.  I tested the surmise (setting the FSM state
+       to "START"), and it results in bad formatting.
+
+       Fixes <https://savannah.gnu.org/bugs/?62191>.  Problem appears
+       to date back to groff 1.02 (June 1991) at the latest.
+
 2022-03-16  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [tbl]: Regression-test Savannah #62191.
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index d6f8a987..f969a027 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -120,8 +120,10 @@ int table_input::get()
       // handle line continuation and uninterpreted leader character
       if ((c = getc(fp)) == '\\') {
        c = getc(fp);
-       if (c == '\n')
-         c = getc(fp);         // perhaps state ought to be START now
+       if (c == '\n') {
+         current_lineno++;
+         c = getc(fp);
+       }
        else if (c == 'a' && compatible_flag) {
          state = LEADER_1;
          return '\\';



reply via email to

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