gbranden pushed a commit to branch master
in repository groff.

commit fc2de06316590258fb197655ea20fbebaf5b5e6f
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Nov 20 11:31:43 2025 -0600

    src/roff/troff/input.cpp: Simplify logic (2/2).
    
    * src/roff/troff/input.cpp (encode_special_character_for_device_output):
      Both branches in this function were doing the same thing, except for a
      null pointer check.  Add anothing null pointer check since, in theory,
      `charinfo::get_symbol()` can return one.  Continues commit c4259eb20a,
      14 September 2024.
---
 ChangeLog                |  9 +++++++++
 src/roff/troff/input.cpp | 13 +++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 464dddba8..1d78729a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-11-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp
+       (encode_special_character_for_device_output): Simplify logic.
+       Both branches in this function were doing the same thing, except
+       for a null pointer check.  Add anothing null pointer check
+       since, in theory, `charinfo::get_symbol()` can return one.
+       Continues commit c4259eb20a, 14 September 2024.
+
 2025-11-20  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (print_character_request)
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 80571b455..8cf444790 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6463,15 +6463,12 @@ static void 
map_special_character_for_device_output(macro *mac,
 static void encode_special_character_for_device_output(macro *mac)
 {
   const char *sc;
-  if (font::use_charnames_in_special) {
-    charinfo *ci = tok.get_charinfo(true /* required */);
-    if (ci != 0 /* nullptr */)
-       sc = ci->get_symbol()->contents();
+  charinfo *ci = tok.get_charinfo(true /* required */);
+  if (ci != 0 /* nullptr */) {
+    sc = ci->get_symbol()->contents();
+    if (sc != 0 /* nullptr */)
+      map_special_character_for_device_output(mac, sc);
   }
-  else
-    sc = tok.get_charinfo(true /* required */)->get_symbol()
-      ->contents();
-  map_special_character_for_device_output(mac, sc);
 }
 
 // In troff output, we translate the escape character to '\', but it is

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

Reply via email to