gbranden pushed a commit to branch master
in repository groff.

commit 1a31239abfacc8ef73abf056f91b82b8f2237940
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 2 21:52:46 2026 -0600

    [soelim]: Fix Savannah #68875.
    
    * src/preproc/soelim/soelim.cpp (do_so): Fix line number reported in
      diagnostic warning of escaped space.
    
    Fixes <https://savannah.gnu.org/bugs/?68875>.  Problem introduced by me
    with the new diagnostic in commit c275819670, 2025-08-02.
---
 ChangeLog                     | 9 +++++++++
 src/preproc/soelim/soelim.cpp | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 2e07e9437..9f82d7e55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-11-02  G. Branden Robinson <[email protected]>
+
+       * src/preproc/soelim/soelim.cpp (do_so): Fix line number
+       reported in diagnostic warning of escaped space.
+
+       Fixes <https://savannah.gnu.org/bugs/?68875>.  Problem
+       introduced by me with the new diagnostic in commit c275819670,
+       2025-08-02.
+
 2026-11-02  G. Branden Robinson <[email protected]>
 
        [soelim]: Regression-test Savannah #68875.
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 6ca8cc3c2..1b00c9bde 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -169,8 +169,13 @@ static void do_so(const char *line)
        filename += '\\';
        break;
       case ' ':
+       // Temporarily decrement the line counter because our caller
+       // incremented it; we're complaining about the `so` line itself.
+       // Postponing the caller's increment creates worse problems.
+       current_lineno--;
        warning("escaping a space is unnecessary and not compatible"
                " with troff syntax");
+       current_lineno++;
        filename += ' ';
        // TODO: groff 1.24.0 release + 2 years?
        // is_filename_valid = false; // or fall through

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

Reply via email to