gbranden pushed a commit to branch master
in repository groff.
commit f29322cac650283d82a1d8885182499ca671efb7
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Jan 6 10:45:42 2026 -0600
Revert "src/roff/troff/input.cpp: Refactor."
This reverts commit f66672e22ca8186fd03bc7a5164f9fff82d64bce.
My beard was not long enough to undertake the task this close to a code
freeze.
Fixes <https://savannah.gnu.org/bugs/?67890>.
---
ChangeLog | 6 ------
src/roff/troff/input.cpp | 19 +++++++++++++++++--
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a5d1133b7..aed9d3448 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -130,12 +130,6 @@
* src/roff/troff/input.cpp (exit_troff, abort_request, do_error)
(fatal_with_file_and_line): Migrate call sites.
-2025-12-29 G. Branden Robinson <[email protected]>
-
- * src/roff/troff/input.cpp: Refactor.
- (abort_request): Replace open-coded logic duplicating an
- existing function with a call of `terminal_write()`.
-
2025-12-29 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Trivially refactor.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 18f7bfe26..944f9bcd9 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -9307,8 +9307,23 @@ const char *readonly_mask_register::get_string()
void abort_request()
{
- terminal_write(true /* do append newline */ ,
- false /* interpret leading spaces */);
+ int c;
+ if (tok.is_eof())
+ c = EOF;
+ else if (tok.is_newline())
+ c = '\n';
+ else {
+ while ((c = read_char_in_copy_mode(0 /* nullptr */)) == ' ')
+ ;
+ }
+ if (!(c == EOF || c == '\n')) {
+ for (;
+ (c != '\n') && (c != EOF);
+ (c = read_char_in_copy_mode(0 /* nullptr */)))
+ fputs(encode_for_stream_output(c), stderr);
+ fputc('\n', stderr);
+ }
+ fflush(stderr);
write_any_trailer_and_exit(EXIT_FAILURE);
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit