groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/17: [troff]: Trivially refactor.


From: G. Branden Robinson
Subject: [groff] 04/17: [troff]: Trivially refactor.
Date: Thu, 18 Jan 2024 14:27:49 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit a94bc669df5d0c771f08e8efafd8a6cef42782ba
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jan 16 13:44:41 2024 -0600

    [troff]: Trivially refactor.
    
    * src/roff/troff/input.cpp (encode_char_for_troff_output): Trivially
      refactor to make clearer what gets silently discarded from (and not
      encoded for) device control commands.
---
 ChangeLog                | 6 ++++++
 src/roff/troff/input.cpp | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 33cb92375..a7cb82d4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-01-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (encode_char_for_troff_output):
+       Trivially refactor to make clearer what gets silently discarded
+       from (and not encoded for) device control commands.
+
 2024-01-14  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [tbl]: Re-fix Savannah #62471 (vrules in nroff and no-space
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index d3d700c0c..c64d6540e 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5623,10 +5623,12 @@ static void encode_char_for_troff_output(macro *mac, 
const char c)
          is_char_valid = false;
       }
     }
-    else if (!(tok.is_hyphen_indicator()
+    else if (tok.is_hyphen_indicator()
               || tok.is_dummy()
               || tok.is_transparent_dummy()
-              || tok.is_zero_width_break()))
+              || tok.is_zero_width_break())
+      /* silently ignore */;
+    else
       is_char_valid = false;
     if (!is_char_valid) {
       if (sc != 0 /* nullptr */)



reply via email to

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