gbranden pushed a commit to branch master
in repository groff.
commit 74fb463c61267a05945308d1c092667c9c26fb6c
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Aug 30 03:57:57 2024 -0500
[troff]: Demote some errors to 'char' warnings.
* src/roff/troff/input.cpp (encode_special_character_for_device_output):
Demote diagnostics arising from non-encodable items from errors to
warnings in category "char", since unlike most (all?) errors, GNU
troff continues processing the input. Clarify language to make it
clearer what is wrong with the rejected input.
Continues fixing Savannah #63074.
---
ChangeLog | 11 +++++++++++
src/roff/troff/input.cpp | 12 ++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 63a60b5d8..c3431a5e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-30 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp
+ (encode_special_character_for_device_output): Demote diagnostics
+ arising from non-encodable items from errors to warnings in
+ category "char", since unlike most (all?) errors, GNU troff
+ continues processing the input. Clarify language to make it
+ clearer what is wrong with the rejected input.
+
+ Continues fixing Savannah #63074.
+
2024-08-30 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 16cc0e7ad..6a31aac01 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5745,16 +5745,16 @@ static void
encode_special_character_for_device_output(macro *mac)
if (un != 0 /* nullptr */)
strncpy(character, un, UNIBUFSZ);
else {
- error("special character '%1' is unusable within a device"
- " control escape sequence", sc);
+ warning(WARN_CHAR, "special character '%1' is not encodable"
+ " in device-independent output", sc);
return;
}
}
else {
const char *un = valid_unicode_code_sequence(sc, errbuf);
if (0 /* nullptr */ == un) {
- error("special character '%1' is unusable within a device"
- " control escape sequence: %2", sc, errbuf);
+ warning(WARN_CHAR, "special character '%1' is not encodable"
+ " in device-independent output: %2", sc, errbuf);
return;
}
strncpy(character, un, UNIBUFSZ);
@@ -5784,8 +5784,8 @@ static void encode_character_for_device_output(macro
*mac, const char c)
else if (tok.is_special())
encode_special_character_for_device_output(mac);
else
- error("%1 is invalid within device control escape sequence",
- tok.description());
+ warning(WARN_CHAR, "%1 is not encodable in device-independent"
+ " output", tok.description());
}
else {
if (c == escape_char)
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit