gbranden pushed a commit to branch master
in repository groff.

commit fac17b4275b2d97c477ac8965449c69b88b8a2cb
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Jun 3 05:33:10 2025 -0500

    [troff]: Drop dead code.
    
    * src/roff/troff/input.cpp (token::next): Drop dead code from `\f` and
      `\F` escape sequence handlers; `read_escape_parameter()` never returns
      a null pointer.  (It can return `NULL_SYMBOL`, but that is an object
      with an address.)
---
 ChangeLog                | 7 +++++++
 src/roff/troff/input.cpp | 4 ----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3593c9b42..c98a0a273 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-06-03  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (token::next): Drop dead code from
+       `\f` and `\F` escape sequence handlers;
+       `read_escape_parameter()` never returns a null pointer.  (It can
+       return `NULL_SYMBOL`, but that is an object with an address.)
+
 2025-06-03  G. Branden Robinson <[email protected]>
 
        [troff]: Refactor, moving font selection logic into a dedicated
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 1c56c40a3..7ce1d83d7 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2321,8 +2321,6 @@ void token::next()
       case 'f':
        {
          symbol s = read_escape_parameter(ALLOW_EMPTY);
-         if (s.is_null())
-           break;
          const char *p;
          for (p = s.contents();
               p != 0 /* nullptr */ && *p != '\0';
@@ -2348,8 +2346,6 @@ void token::next()
       case 'F':
        {
          symbol s = read_escape_parameter(ALLOW_EMPTY);
-         if (s.is_null())
-           break;
          curenv->set_family(s);
          have_formattable_input = true;
          break;

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

Reply via email to