bugGNU roff - Bugs: bug #63299, [eqn] reports incorrect line...

 
 

bug #63299: [eqn] reports incorrect line numbers in diagnostics

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Mon 31 Oct 2022 11:58:20 PM UTC
   
 
Category:  Preprocessor eqn Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 01 Nov 2022 01:34:23 AM UTC, 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.


G. Branden Robinson <gbranden>
Group administrator
Tue 01 Nov 2022 01:03:45 AM UTC, comment #1: 
G. Branden Robinson <gbranden>
Group administrator
Mon 31 Oct 2022 11:58:20 PM UTC, original submission:  

See in groff 1.22.4.


$ echo .EQ | eqn >/dev/null
eqn:<standard input>:2: fatal error: end of file before .EN


...but there is no "line 2".


$ printf ".EQ\nx\n.EN\n.lf 99\n\200\n" | eqn >/dev/null
eqn:<standard input>:98: invalid input character code '128'


A line number of 98 (after it has been set to 99) is also obviously incorrect.

Thanks to Alex Colomar for the report.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  • -email is unavailable- added by gbranden (original reporter)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-01 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2022-10-31 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code