URL:
  <https://savannah.gnu.org/bugs/?61174>

                 Summary: [libgroff] misleading line numbers in some device
description file diagnostics
                 Project: GNU troff
            Submitted by: gbranden
            Submitted on: Fri 17 Sep 2021 06:17:19 AM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Warning/Suspicious behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

A spurious line number is reported for bad `sizescale`, `hor`, and `vert`
directives in the DESC file.

For example, we can take the devps DESC file and make its `sizescale` value
negative.


$ nl build/font/devps/DESC
     1  res 72000
     2  hor 1
     3  vert 1
     4  sizescale -1000
     5  unitwidth 1000
     6  sizes 1000-10000000 0
     7  styles R I B BI
     8  family T
     9  fonts 9 0 0 0 0 0 SS S ZD ZDR
    10  tcommand
    11  postpro grops
    12  broken 0
    13  papersize letter
    14  print lpr
$ GROFF_FONT_PATH=./build/font groff
groff:./build/font/devps/DESC:14: bad 'sizescale' value
groff: fatal error: invalid device 'ps'


Because `font::load_desc()` reads the whole file before validating these
values, it associates a misleading line number with the diagnostic messages.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61174>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply via email to