gbranden pushed a commit to branch master
in repository groff.
commit 79cc64b371dafb43786c62f0d56aaa27a61dea0b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 2 09:46:15 2025 -0600
src/roff/troff/input.cpp: Slightly refactor.
* src/roff/troff/input.cpp (is_conditional_expression_true):
Parenthesize formally complex expressions.
---
ChangeLog | 6 ++++++
src/roff/troff/input.cpp | 6 +++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 882725ed6..410ad2cbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-10-31 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp: Slightly refactor.
+ (is_conditional_expression_true): Parenthesize formally complex
+ expressions.
+
2025-10-31 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Refactor.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index ae332ed96..8edaf3607 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6732,14 +6732,14 @@ static bool is_conditional_expression_true()
result = !(topdiv->get_page_number() & 1);
tok.next();
}
- else if (c == 'd' || c == 'r') {
+ else if ((c == 'd') || (c == 'r')) {
tok.next();
symbol nm = get_name(true /* required */);
if (nm.is_null()) {
skip_branch();
return false;
}
- result = (c == 'd'
+ result = ((c == 'd')
? request_dictionary.lookup(nm) != 0 /* nullptr */
: register_dictionary.lookup(nm) != 0 /* nullptr */);
}
@@ -6750,7 +6750,7 @@ static bool is_conditional_expression_true()
skip_branch();
return false;
}
- result = (nm == default_symbol
+ result = ((nm == default_symbol)
|| color_dictionary.lookup(nm) != 0 /* nullptr */);
}
else if (c == 'c') {
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit