gbranden pushed a commit to branch master
in repository groff.
commit a0171c9dc12daa8e70b9178bfac63aa11745110b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Jan 27 18:18:01 2025 -0600
[troff]: Fix Savannah #66723 (`hys` broken).
* src/roff/troff/env.cpp (environment::choose_breakpoint):
Reparenthensize (very) complex expression, restoring documented
behavior of hyphenation space feature. Problem introduced by me in
commit d2dceabb83, 30 August.
Fixes <https://savannah.gnu.org/bugs/?66723>. Thanks to Dave Kemper for
the report.
"The issue's not whether you've parenthesized your complex expressions,
Lenny...the issue is whether you've parenthesized your complex
expressions _enough_."
---
ChangeLog | 10 ++++++++++
src/roff/troff/env.cpp | 10 +++++-----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cfaf0ee78..f8e3a1c49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-01-27 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (environment::choose_breakpoint):
+ Reparenthensize (very) complex expression, restoring documented
+ behavior of hyphenation space feature. Problem introduced by me
+ in commit d2dceabb83, 30 August.
+
+ Fixes <https://savannah.gnu.org/bugs/?66723>. Thanks to Dave
+ Kemper for the report.
+
2025-01-27 G. Branden Robinson <[email protected]>
[groff]: Regression-test Savannah #66723.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index e57f3aefa..0e83cf46a 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2042,11 +2042,11 @@ breakpoint *environment::choose_breakpoint()
// Don't choose the hyphenated breakpoint if the line
// can be justified by adding no more than
// hyphenation_space to any word space.
- ? (bp->nspaces > 0
- && ((((target_text_length - bp->width)
- + ((bp->nspaces - 1) * hresolution)
- / bp->nspaces))
- <= hyphenation_space))
+ ? ((bp->nspaces > 0)
+ && (((target_text_length - bp->width)
+ + ((bp->nspaces - 1) * hresolution))
+ / bp->nspaces)
+ <= hyphenation_space)
// Don't choose the hyphenated breakpoint if the line
// is no more than hyphenation_margin short of the
// line length.
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit