[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #63299] [eqn] reports incorrect line numbers in diagnostics
From: |
G. Branden Robinson |
Subject: |
[bug #63299] [eqn] reports incorrect line numbers in diagnostics |
Date: |
Mon, 31 Oct 2022 21:34:23 -0400 (EDT) |
Update of bug #63299 (project groff):
Status: In Progress => Fixed
Open/Closed: Open => Closed
Planned Release: None => 1.23.0
_______________________________________________________
Follow-up Comment #2:
commit 7e23e1342077a6d7c0b02c3d666f131d95f2b510
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date: Mon Oct 31 19:34:36 2022 -0500
[eqn]: Regression-test Savannah #63299.
* src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh: Do
it.
* src/preproc/eqn/eqn.am (eqn_TESTS, TESTS, EXTRA_DIST): Run test.
Test fails at this commit.
commit dc98a8b09e7f3dcfe968b978eb210f468db78cc9
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date: Mon Oct 31 20:01:34 2022 -0500
[eqn]: Fix Savannah #63299.
* src/preproc/eqn/main.cpp: Revise input file line number handling.
(read_line): Stop dealing with `current_lineno` here; it's now up to
its caller (`do_file()`) to manipulate the line number.
(do_file): When reading new file, initialize `current_lineno` to
1 instead of 0. Reset it to zero when encountering EOF (so that
diagnostics will not include a line number at all). When performing
nested call to `read_line()` to gather '.EN' from input, increment
the line number. Write correct line number in output groff `lf`
requests; in groff, its first argument assigns the number of the
_next_ input line. Increment line number at end of outer
`read_line()` loop.
Fixes <https://savannah.gnu.org/bugs/index.php?63299>. Thanks to Alex
Colomar for the report.
Also wrap long input lines and add explanatory comments.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63299>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/