a third focussed bust of the C/C++ code freeze
"G. Branden Robinson" <[email protected]>
| Newsgroups | gmane.comp.printing.groff.general |
|---|---|
| Message-ID | <20260206194848.cu2ogqaeco2isbpe@illithid> |
Here's the patch. It fixes a spurious error message when building the
NetHack Guidebook.
diff --git a/ChangeLog b/ChangeLog
index da0df963e..fe7fee072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -851,21 +851,6 @@
* src/roff/troff/div.cpp: Include local "input.h" header file to
get at the symbol's relocated declaration.
-2025-12-29 G. Branden Robinson <[email protected]>
-
- * src/roff/troff/env.cpp: Refactor. Further separate input
- processing logic from engine logic.
- (environment::do_break): Rename argument from `want_adjustment`
- to `want_forced_adjustment` for clarity.
- (break_output_line): Stop checking value of `want_break` global
- here, as that's determined by the input control character used
- to invoke the request, a front-end rather than an engine concern
- {albeit brearing an engine-oriented name}. However, removing
- that conditional leaves this function as a one-liner with two
- call sites differing only by a Boolean literal argument, so drop
- the function altogether, instead open-coding it...
- (break_without_adjustment, break_without_adjustment): ...here.
-
2025-12-29 G. Branden Robinson <[email protected]>
[groff]: Unit-test `br` and `brp` requests.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index b49471f2a..90880c3fe 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2645,18 +2645,23 @@ bool environment::is_empty()
&& pending_lines == 0 /* nullptr */;
}
-static void break_without_forced_adjustment_request()
+void do_break_request(bool want_adjustment)
{
+ while (!tok.is_newline() && !tok.is_eof())
+ tok.next();
if (was_invoked_with_regular_control_character)
- curenv->do_break(false /* want forced adjustment */);
- skip_line();
+ curenv->do_break(want_adjustment);
+ tok.next();
+}
+
+static void break_without_forced_adjustment_request()
+{
+ do_break_request(false);
}
static void break_with_forced_adjustment_request()
{
- if (was_invoked_with_regular_control_character)
- curenv->do_break(true /* want forced adjustment */);
- skip_line();
+ do_break_request(true);
}
void title()
Rationale, background: https://savannah.gnu.org/bugs/?68026
Regards,
Branden
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmmGRZUACgkQ0Z6cfXEm bc5neg/+MDUr2DQak0J7SI3k+EkEyWPqSvGeoM+uWKv3pl+eoE4SWIXRVpPrTD20 /r0aoVwjTljVW/GztWhedZhBy4lctNzcPpvOyMjRBZtsHo9y7gpWeLayM3nP07rp ZZBKZW8GeCfGWxnMVd+g/cnboPeb61if/C45K6huP9Yi6DRbeU5Tj3je0oxXMjdH vfmcuUSK6BpmU5zr2GwZfONtHljSvZqTXV/ttDDUCu6Bbpw4TsvUhrMMmwkhbdSE kcsuCw6uZHfAyx/0kWc72VmuYCNmfANIzJrs5Cq35kr+rInImZDA+ZcFLZBWlP+4 Tmck9eEQLOUfsVvHFnnzTlqgkAz40q1LShyIj5ef2IB9cT1ACBPVUaR7NomKSDEr iNa69Mpnw/bYfTkAoLzrn+thuabG/bpWxQumHCSNin4eeTVSSeLOBxcYLxh2kPl6 SSv+95SgxQYcMneoOlxaTSh+yI+iQRJ3NblSpPsV+/9toHD6VAdMef9DjYb3oqbE TEpiq8xYNjM5AY6F88Dg2It/recboVNEAIwnengiKnsyzbYj0G1oRJPYz4/tCKu7 E+M3Uc8PlKq2v4MqUEA6X+gSXWG8oOsVwi5YwulLIpIA0kpJySFlqk6e4ZwoTnWp 7wPpF2VoY7FzQOiVPWDz4Mzc8Ve8pK36mY1jtpVVsZsBKGQWuVs= =s7OJ -----END PGP SIGNATURE-----