gbranden pushed a commit to branch master
in repository groff.

commit b3eaa387ea77648ff7875bdc05c996835f8f0cd4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Oct 23 15:00:02 2026 -0500

    [tbl]: Fix Savannah #68825.
    
    * src/preproc/tbl/table.cpp (table::add_entry): Fix duplicative and
      misleading warning about *roff comment escape sequences in table
      entries arising due to logic error.  Resequence update of `commentpos`
      local to follow warning about use of `\#` in table entry, and revise a
      conditional to use `gcommentpos`.
    
    Fixes <https://savannah.gnu.org/bugs/?68825>.  Problem introduced by me
    in commit 207723e5bf, 2024-10-06.
---
 ChangeLog                 | 11 +++++++++++
 src/preproc/tbl/table.cpp |  6 +++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ead54264b..c488e2c38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-10-23  G. Branden Robinson <[email protected]>
+
+       * src/preproc/tbl/table.cpp (table::add_entry): Fix duplicative
+       and misleading warning about *roff comment escape sequences in
+       table entries arising due to logic error.  Resequence update of
+       `commentpos` local to follow warning about use of `\#` in table
+       entry, and revise a conditional to use `gcommentpos`.
+
+       Fixes <https://savannah.gnu.org/bugs/?68825>.  Problem
+       introduced by me in commit 207723e5bf, 2024-10-06.
+
 2026-10-22  G. Branden Robinson <[email protected]>
 
        [troff]: Fix Savannah #68819.
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 5ed057025..633c6de60 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1558,15 +1558,15 @@ void table::add_entry(int r, int c, const string &str,
     }
     int gcommentpos = str.find("\\#");
     // If both types of comment are present, the first is what matters.
-    if ((gcommentpos != -1) && (gcommentpos < commentpos))
-      commentpos = gcommentpos;
-    if (commentpos != -1) {
+    if (gcommentpos != -1) {
       int controlpos = str.search('.');
       if ((-1 == str.search('\n')) // not a text block, AND
          && ((-1 == controlpos) // (no control character in line OR
              || (0 == controlpos))) // control character at line start)
        warning_with_file_and_line(fn, ln, "comment escape sequence"
                                   " '\\#' in entry \"%1\"", s);
+      if (gcommentpos < commentpos)
+       commentpos = gcommentpos;
     }
     // A \! escape sequence after a comment has started is okay.
     int exclpos = str.find("\\!");

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to