gbranden pushed a commit to branch master
in repository groff.
commit f6151a12bb49eacc982606917534d89303a30c8a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Aug 18 09:02:01 2024 -0500
[troff]: Tweak `\Z` diagnostic output.
* src/roff/troff/input.cpp (do_zero_width): Do it.
---
ChangeLog | 5 +++++
src/roff/troff/input.cpp | 7 +++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2429fd19e..62fc03182 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-08-18 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (do_zero_width): Tweak `\Z`
+ diagnostic output.
+
2024-08-18 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (read_drawing_command): Trivially
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 6a4e2561c..1ae67986c 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1770,7 +1770,7 @@ static node *do_zero_width() // \Z
// diagnostic.
char *delimdesc = strdup(start_token.description());
warning(WARN_DELIM, "missing closing delimiter in zero-width"
- " escape sequence; expected %1, got %2", delimdesc,
+ " output escape sequence; expected %1, got %2", delimdesc,
tok.description());
free(delimdesc);
// Synthesize an input line ending.
@@ -1780,8 +1780,11 @@ static node *do_zero_width() // \Z
if (tok == start_token
&& (compatible_flag || input_stack::get_level() == start_level))
break;
+ // XXX: does the initial dummy node leak if this fails?
+ // TODO: Say something better than "token" in the diagnostic.
if (!tok.add_to_zero_width_node_list(&rev))
- error("invalid token in argument to escaped 'Z'");
+ error("invalid token in argument to zero-width output escape"
+ " sequence");
}
while (rev != 0 /* nullptr */) {
node *tem = rev;
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit