gbranden pushed a commit to branch master
in repository groff.

commit b4397231a0214b054c40577657e6dbd50fdd31a1
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Mar 22 16:32:40 2025 -0500

    [troff]: Fix Savannah #66675 (`char` interps).
    
    * src/roff/troff/input.cpp (token::next): Stop throwing an error
      diagnostic and aborting interpretation of a special character
      identifier when it starts with "u" and is of length > 2.  For example,
      `\[unhappy]` is a valid special character interpolation, simply not a
      _Unicode_ special character interpolation.  Also solves the same
      problem when reading special character identifiers from font
      description files.
    
    Fixes <https://savannah.gnu.org/bugs/?66675>.  Thanks to Dave Kemper for
    the report.  Problem introduced by me in commit 6bf627403c, 4 September.
---
 ChangeLog                | 14 ++++++++++++++
 src/roff/troff/input.cpp |  8 +-------
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c53af8b07..66dd4f7c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-03-22  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (token::next): Stop throwing an error
+       diagnostic and aborting interpretation of a special character
+       identifier when it starts with "u" and is of length > 2.  For
+       example, `\[unhappy]` is a valid special character
+       interpolation, simply not a _Unicode_ special character
+       interpolation.  Also solves the same problem when reading
+       special character identifiers from font description files.
+
+       Fixes <https://savannah.gnu.org/bugs/?66675>.  Thanks to Dave
+       Kemper for the report.  Problem introduced by me in commit
+       6bf627403c, 4 September.
+
 2025-03-21  G. Branden Robinson <[email protected]>
 
        * src/utils/afmtodit/afmtodit.pl (croak, whine): Fix my
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 1b18403ce..def138e7b 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2564,14 +2564,8 @@ void token::next()
            char errbuf[ERRBUFSZ];
            const char *sc = s.contents();
            const char *gn = 0 /* nullptr */;
-           if ((strlen(sc) > 2) && (sc[0] == 'u')) {
+           if ((strlen(sc) > 2) && (sc[0] == 'u'))
              gn = valid_unicode_code_sequence(sc, errbuf);
-             if (0 /* nullptr */ == gn) {
-               error("special character '%1' is invalid: %2", sc,
-                     errbuf);
-               break;
-             }
-           }
            if (gn != 0 /* nullptr */) {
              const char *gn_decomposed = decompose_unicode(gn);
              if (gn_decomposed)

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

Reply via email to