[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 27/41: [troff]: Quieten "transparent" error diagnostics.
From: |
G. Branden Robinson |
Subject: |
[groff] 27/41: [troff]: Quieten "transparent" error diagnostics. |
Date: |
Sat, 5 Mar 2022 16:06:17 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 557bc0558dfdee7e3f2011433cf4606052e4e7e1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Mar 5 04:21:48 2022 +1100
[troff]: Quieten "transparent" error diagnostics.
* src/roff/troff/div.cpp (top_level_diversion::transparent_output):
* src/roff/troff/input.cpp (transparent_translate): Suppress two
troublesome (i.e., more or less spurious) error diagnostics about
transparent output/throughput unless the environment variable
`GROFF_ENABLE_TRANSPARENCY_WARNINGS` is present. This is a bit of a
bodge until we get diversion sanitization worked out. See Savannah
#61407.
---
ChangeLog | 11 +++++++++++
src/roff/troff/div.cpp | 3 ++-
src/roff/troff/input.cpp | 10 ++++++----
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b3d6e157..40f2bc74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-03-05 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/roff/troff/div.cpp
+ (top_level_diversion::transparent_output):
+ * src/roff/troff/input.cpp (transparent_translate): Suppress two
+ troublesome (i.e., more or less spurious) error diagnostics
+ about transparent output/throughput unless the environment
+ variable `GROFF_ENABLE_TRANSPARENCY_WARNINGS` is present. This
+ is a bit of a bodge until we get diversion sanitization worked
+ out. See Savannah #61407.
+
2022-03-04 G. Branden Robinson <g.branden.robinson@gmail.com>
[preconv]: Stop assuming that the default input stream, or an
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 492d1ff4..94db0006 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -433,7 +433,8 @@ void top_level_diversion::transparent_output(unsigned char
c)
void top_level_diversion::transparent_output(node * /*n*/)
{
- error("can't transparently output node at top level");
+ if (getenv("GROFF_ENABLE_TRANSPARENCY_WARNINGS") != 0 /* nullptr */)
+ error("can't transparently output node at top level");
}
void top_level_diversion::copy_file(const char *filename)
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8a3d61b1..ddd8a476 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2693,10 +2693,12 @@ static int transparent_translate(int cc)
int c = ci->get_ascii_code();
if (c != '\0')
return c;
- error("can't translate %1 to special character '%2'"
- " in transparent throughput",
- input_char_description(cc),
- ci->nm.contents());
+ if (getenv("GROFF_ENABLE_TRANSPARENCY_WARNINGS")
+ != 0 /* nullptr */)
+ error("can't translate %1 to special character '%2'"
+ " in transparent throughput",
+ input_char_description(cc),
+ ci->nm.contents());
}
}
return cc;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 27/41: [troff]: Quieten "transparent" error diagnostics.,
G. Branden Robinson <=