* src/roff/troff/input.cpp (do_overstrike, do_bracket) (do_name_test, do_zero_width_output, do_register) (read_title_parts, do_device_extension, read_drawing_command): Fix misleading warnings in category "delim"; when reporting use of a deprecated delimiter, identify the correct token as deprecated. This change also avoids assert(3)ion failures when `NDEBUG` is not defined and the input parser is in a certain state.
Fixes <https://savannah.gnu.org/bugs/?68832>. Problem introduced by me in commits d7824cb7ba, 12032e1211, a38054a1d1, 201833b36d, 5d570e2210, ffcf52f605, and b459b2c6b0, (all 2025-11-23) and commit 4b09e1688c, 2025-12-29. --- ChangeLog | 18 ++++++++++++++++++ src/roff/troff/input.cpp | 16 ++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3018a96e9..5fcd2a5eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2026-10-25 G. Branden Robinson <[email protected]> + + [troff]: Fix Savannah #68832. + + * src/roff/troff/input.cpp (do_overstrike, do_bracket) + (do_name_test, do_zero_width_output, do_register) + (read_title_parts, do_device_extension, read_drawing_command): + Fix misleading warnings in category "delim"; when reporting use + of a deprecated delimiter, identify the correct token as + deprecated. This change also avoids assert(3)ion failures when + `NDEBUG` is not defined and the input parser is in a certain + state. + + Fixes <https://savannah.gnu.org/bugs/?68832>. Problems + introduced by me in commits d7824cb7ba, 12032e1211, a38054a1d1, + 201833b36d, 5d570e2210, ffcf52f605, and b459b2c6b0, (all + 2025-11-23) and commit 4b09e1688c, 2025-12-29. + 2026-10-25 G. Branden Robinson <[email protected]> [groff]: Regression-test Savannah #68832. diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index 75940d503..28747aaee 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -1780,7 +1780,7 @@ node *do_overstrike() // \o start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { @@ -1846,7 +1846,7 @@ static node *do_bracket() // \b start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { @@ -1903,7 +1903,7 @@ static const char *do_name_test() // \A start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { @@ -2038,7 +2038,7 @@ static node *do_zero_width_output() // \Z start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { @@ -6607,7 +6607,7 @@ static void do_register() // \R start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { @@ -6722,7 +6722,7 @@ void read_title_parts(node **part, hunits *part_width) token start(tok); if (!want_att_compat && !tok.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as a title request delimiter" - " is deprecated", tok.description()); + " is deprecated", start.description()); int start_level = input_stack::get_level(); tok.next(); for (int i = 0; i < 3; i++) { @@ -6979,7 +6979,7 @@ static node *do_device_extension() // \X start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { @@ -10745,7 +10745,7 @@ static node *read_drawing_command() // \D start_token.next(); if (!want_att_compat && !start_token.is_usable_as_delimiter()) warning(WARN_DELIM, "using %1 as an escape sequence delimiter" - " is deprecated", tok.description()); + " is deprecated", start_token.description()); else if (want_att_compat && !start_token.is_usable_as_delimiter(false, DELIMITER_ATT_STRING_EXPRESSION)) { -- 2.39.5
signature.asc
Description: PGP signature
