groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/16: [troff]: Restore diagnostic from groff 1.22.4.


From: G. Branden Robinson
Subject: [groff] 03/16: [troff]: Restore diagnostic from groff 1.22.4.
Date: Wed, 10 Jan 2024 23:55:03 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 363fac9d0c09da8c78919ebbbd70539eb0893be5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jan 9 07:48:38 2024 -0600

    [troff]: Restore diagnostic from groff 1.22.4.
    
    * src/roff/troff/input.cpp (encode_char): Add `else` to `if` statement
      checking the output device for the "use_charnames_in_special"
      directive (used only by grohtml(1)).  This way we once again throw a
      diagnostic upon the following input, invalid with any other output
      device.
    
            printf '\\X@pdf: \\[u1234]@\n' | groff
    
      Problem introduced by me in commit eb695ab2b5, 30 October 2021.
    
    Also fix incorrect indentation.
---
 ChangeLog                | 14 ++++++++++++++
 src/roff/troff/input.cpp |  7 +++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd26376f3..0bc0226b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-01-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [troff]: Restore diagnostic from groff 1.22.4.
+
+       * src/roff/troff/input.cpp (encode_char): Add `else` to `if`
+       statement checking the output device for the
+       "use_charnames_in_special" directive (used only by grohtml(1)).
+       This way we once again throw a diagnostic upon the following
+       input, invalid with any other output device.
+
+               printf '\\X@pdf: \\[u1234]@\n' | groff
+
+       Problem introduced by me in commit eb695ab2b5, 30 October 2021.
+
 2024-01-05  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * font/devpdf/Foundry.in: More BMI, BMR mapping swap; swap the
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a0b987634..cf24bbcfd 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5612,9 +5612,12 @@ static void encode_char(macro *mac, char c)
            mac->append(']');
          }
          else
-             error("special character '%1' cannot be used within"
-                   " device control escape sequence", sc);
+           error("special character '%1' cannot be used within a"
+                 " device control escape sequence", sc);
        }
+       else
+         error("special character '%1' cannot be used within a device"
+               " control escape sequence", sc);
       }
     }
     else if (!(tok.is_hyphen_indicator()



reply via email to

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