gbranden pushed a commit to branch master
in repository groff.
commit effd6835dc479834832640c37cd06b1cc1e0ee67
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Nov 19 22:26:07 2025 -0600
[troff]: Eliminate an error diagnostic.
* src/roff/troff/env.cpp (add_hyphenation_exceptions): Drop `error()`
call prior to `assert()`. It's okay if, when built with the
preprocessor `NDEBUG` symbol defined, we silently discard the
remainder of the input line and resume reading the next. Should feel
familiar to users of AT&T troff. (Also, this makes a forthcoming
change easier.)
---
ChangeLog | 9 +++++++++
src/roff/troff/env.cpp | 5 ++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2dfb2de49..dc9323c4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,15 @@
* src/roff/troff/input.cpp (read_title_parts): Avoid null
pointer dereference.
+2025-11-19 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (add_hyphenation_exceptions): Drop
+ `error()` call prior to `assert()`. It's okay if, when built
+ with the preprocessor `NDEBUG` symbol defined, we silently
+ discard the remainder of the input line and resume reading the
+ next. Should feel familiar to users of AT&T troff. (Also, this
+ makes a forthcoming change easier.)
+
2025-11-19 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (margin_character): Trivially refactor.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 5f990004f..dd90bf030 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3849,9 +3849,8 @@ static void add_hyphenation_exceptions()
&& !tok.is_eof()) {
charinfo *ci = tok.get_charinfo(true /* required */);
if (0 /* nullptr */ == ci) {
- error("%1 has no associated character information(!)",
- tok.description());
- assert(0 == "unexpected null pointer to charinfo of token");
+ assert(0 == "attempted to use token without charinfo in"
+ " hyphenation exception word");
skip_line();
return;
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit