gbranden pushed a commit to branch master
in repository groff.
commit 7d037578925806d247684a1b35bd11e8103711b9
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun May 24 22:34:27 2026 -0500
[troff]: Fix Savannah #68395.
* src/roff/troff/node.cpp (define_font_specific_character_request):
Check for presence of arguments after the first before handing off
processing of the remainder of the input line to `define_character()`.
Resolves assertion failure thrown by the latter function.
Fixes <https://savannah.gnu.org/bugs/?68395>.
---
ChangeLog | 10 ++++++++++
src/roff/troff/node.cpp | 17 +++++++++++------
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1692e2041..bb5a15dd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-05-24 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/node.cpp
+ (define_font_specific_character_request): Check for presence of
+ arguments after the first before handing off processing of the
+ remainder of the input line to `define_character()`. Resolves
+ assertion failure thrown by the latter function.
+
+ Fixes <https://savannah.gnu.org/bugs/?68395>.
+
2026-05-24 G. Branden Robinson <[email protected]>
[groff]: Regression-test Savannah #68395.
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 75cd63766..9d3fe7bbe 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -7117,15 +7117,20 @@ static void define_font_specific_character_request() //
.fschar
if (!read_font_identifier(&finfo)) {
font_lookup_error(finfo, "to define font-specific fallback"
" character");
- // Normally we skip the remainder of the line unconditionally at the
- // end of a request-implementing function, but define_character()
- // will eat the rest of it for us.
skip_line();
+ return;
}
- else {
- symbol f = font_table[finfo.position]->get_name();
- define_character(CHAR_FONT_SPECIFIC_FALLBACK, f.contents());
+ if (!has_arg()) {
+ warning(WARN_MISSING, "font-specific fallback character definition"
+ " request expects character definition argument");
+ skip_line();
+ return;
}
+ symbol f = font_table[finfo.position]->get_name();
+ define_character(CHAR_FONT_SPECIFIC_FALLBACK, f.contents());
+ // Normally we skip the remainder of the line unconditionally at the
+ // end of a request-implementing function, but `define_character()`
+ // eats the rest of it for us.
}
static void remove_font_specific_character_request() // .rfschar
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit