gbranden pushed a commit to branch master
in repository groff.
commit 10280b55755a6199e3c0b0f6a5a0381799601b4a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Jul 10 10:54:39 2025 -0500
[eqn]: Stop validating non-intepreted input.
...for character codes acceptable to GNU troff.
* src/preproc/eqn/main.cpp (read_line): Revise fix for Savannah #67285;
stop tracking whether a *roff comment has been seen in the input, and
thus stop throwing an invalid character diagnostic under any
circumstance (within this function; "lex.cpp" continues to, when
interpreting eqn input proper). The idea is that eqn, like grn, pic,
refer, soelim, and tbl, is a _filter_. Its job is to transform only
_part_ of its input stream and leave the rest unaltered.
* src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh:
Comment out now-inapplicable checks.
---
ChangeLog | 15 +++++++++++++++
src/preproc/eqn/main.cpp | 11 -----------
.../tests/diagnostics-report-correct-line-numbers.sh | 20 +++++++++++---------
3 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a66f2e72f..ffa0059b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2025-07-10 G. Branden Robinson <[email protected]>
+
+ * src/preproc/eqn/main.cpp (read_line): Revise fix for Savannah
+ #67285; stop tracking whether a *roff comment has been seen in
+ the input, and thus stop throwing an invalid character
+ diagnostic under any circumstance (within this function;
+ "lex.cpp" continues to, when interpreting eqn input proper).
+ The idea is that eqn, like grn, pic, refer, soelim, and tbl, is
+ a _filter_. Its job is to transform only _part_ of its input
+ stream and leave the rest unaltered.
+
+ * src/preproc/eqn/tests/\
+ diagnostics-report-correct-line-numbers.sh: Comment out now-
+ inapplicable checks.
+
2025-07-10 G. Branden Robinson <[email protected]>
* tmac/de.tmac (_td_format) [@R]: Fix German date localization
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index f09d18c5c..e93ee4dd1 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -85,19 +85,8 @@ static bool read_line(FILE *fp, string *p)
{
p->clear();
int c = -1;
- bool seen_backslash = false;
- bool in_comment = false;
while ((c = getc(fp)) != EOF) {
- // Don't throw invalid input errors inside *roff comments.
- if (seen_backslash && (('"' == c) || ('#' == c)))
- in_comment = true;
- if ('\\' == c)
- seen_backslash = true;
- else
- seen_backslash = false;
*p += char(c);
- if (is_invalid_input_char(c) && !in_comment)
- error("invalid input (%1)", input_char_description(c));
if (c == '\n')
break;
}
diff --git a/src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh
b/src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh
index b9deb60a3..e1f4904a1 100755
--- a/src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh
+++ b/src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh
@@ -56,15 +56,17 @@ input='.EQ
error=$(printf '%s\n' "$input" | "$eqn" 2>&1 > /dev/null)
echo "$error" | grep -Eq '^[^:]+:[^:]+:2: fatal' || wail
-echo "checking for correct line number in invalid input character" \
- "diagnostic" >&2
-error=$(printf '.EQ\nx\n.EN\n\200\n' | "$eqn" 2>&1 > /dev/null)
-echo "$error" | grep -Eq '^[^:]+:[^:]+:4: error' || wail
-
-echo "checking for correct line number in invalid input character" \
- "diagnostic when 'lf' request used beforehand" >&2
-error=$(printf '.EQ\nx\n.EN\n.lf 99\n\200\n' | "$eqn" 2>&1 > /dev/null)
-echo "$error" | grep -Eq '^[^:]+:[^:]+:99: error' || wail
+# Per Savannah #67285, eqn no longer emits this diagnostic.
+#
+#echo "checking for correct line number in invalid input character" \
+# "diagnostic" >&2
+#error=$(printf '.EQ\nx\n.EN\n\200\n' | "$eqn" 2>&1 > /dev/null)
+#echo "$error" | grep -Eq '^[^:]+:[^:]+:4: error' || wail
+#
+#echo "checking for correct line number in invalid input character" \
+# "diagnostic when 'lf' request used beforehand" >&2
+#error=$(printf '.EQ\nx\n.EN\n.lf 99\n\200\n' | "$eqn" 2>&1 > /dev/null)
+#echo "$error" | grep -Eq '^[^:]+:[^:]+:99: error' || wail
echo "checking for correct line number when invalid 'lf' request used" \
>&2
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit