gbranden pushed a commit to branch master
in repository groff.

commit c275819670995027dac9839d12008fac91897d12
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Aug 2 04:00:37 2025 -0500

    [solem]: Warn if `\ ` used in `so` argument.
    
    * src/preproc/soelim/soelim.cpp (do_so): Throw warning if input document
      backslash-escapes a space in a `so` token argument.  As the diagnostic
      message notes, doing so is not compatible with (any) troff's syntax,
      and is (now, in GNU soelim and troff) unnecessary for handling of
      spacey file names.
---
 ChangeLog                     | 8 ++++++++
 src/preproc/soelim/soelim.cpp | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 62bc7b4e1..ba0a5f594 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-08-02  G. Branden Robinson <[email protected]>
+
+       * src/preproc/soelim/soelim.cpp (do_so): Throw warning if input
+       document backslash-escapes a space in a `so` token argument.  As
+       the diagnostic message notes, doing so is not compatible with
+       {any} troff's syntax, and is (now, in GNU soelim and troff)
+       unnecessary for handling of spacey file names.
+
 2025-07-27  G. Branden Robinson <[email protected]>
 
        [mdoc]: Make man page rendering more robust against meddling
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 75da9db97..9ada7563e 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -156,7 +156,11 @@ void do_so(const char *line)
        filename += '\\';
        break;
       case ' ':
+       warning("escaping a space is unnecessary and not compatible"
+               " with troff syntax");
        filename += ' ';
+       // TODO: groff 1.24.0 release + 2 years?
+       // is_filename_valid = false; // or fall through
        break;
       default:
        is_filename_valid = false;

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

Reply via email to