gbranden pushed a commit to branch master
in repository groff.
commit eabff1b58417cd067ea1fd215509055837266e98
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Mar 28 14:31:14 2026 -0500
src/roff/troff/env.cpp: Invert corner-case retval.
* src/roff/troff/env.cpp (environment::set_font): Invert returned
Boolean value when this function is activated on a font-change
operation that lies on the unformatted portion of an input line
interrupted/continued with `\c`. Returning "true" was inconsistent
with other environment mutator functions in this file, including the
signature of this member function taking an integer (rather than a
`symbol`) argument. Eventually, we should make these functions
unreachable in such circumstances. See Savannah #67812.
---
ChangeLog | 12 ++++++++++++
src/roff/troff/env.cpp | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 3295aec05..ad15dc60a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-03-28 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (environment::set_font): Invert
+ returned Boolean value when this function is activated on a
+ font-change operation that lies on the unformatted portion of an
+ input line interrupted/continued with `\c`. Returning "true"
+ was inconsistent with other environment mutator functions in
+ this file, including the signature of this member function
+ taking an integer (rather than a `symbol`) argument.
+ Eventually, we should make these functions unreachable in such
+ circumstances. See Savannah #67812.
+
2026-03-28 G. Branden Robinson <[email protected]>
[troff]: Rename `WARN_INVALID` enumeration constant to
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index ba62a7718..04cc77a22 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -624,7 +624,7 @@ static void warn_if_font_name_deprecated(symbol nm)
bool environment::set_font(symbol nm)
{
if (was_line_interrupted)
- return true; // "no operation" is successful
+ return false;
// TODO: Kill this off in groff 1.24.0 release + 2 years.
if (is_device_ps_or_pdf)
warn_if_font_name_deprecated(nm);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit