Update of bug #64155 (project groff):

                  Status:             In Progress => Ready for Merge        

    _______________________________________________________

Follow-up Comment #16:

Fixed on my branch.

And oh, look, a bug number typo in the commit message.  Ah, but I can fix it
when merging to master.


commit 1fea0c142fae929cce003d6e529e000687149735
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
Date:   Thu May 25 05:35:25 2023 -0500

    [troff]: Validate a font family before using it.
    
    * src/roff/troff/env.cpp (is_family_valid): New function checks for all
      text styles (R, I, B, BI) and returns true only if the given family
      supports them all.
    
      (family_change): Call `is_family_valid()` on given argument.  If
      invalid, throw diagnostic and ignore `fam` request.
    
    * src/roff/troff/env.h (is_family_valid): Declare; make visible.
    
    * src/roff/troff/input.cpp (main): Call `is_family_valid()` on `-f`
      option argument.  Its invalidity is a fatal error.
    
    Fixes <https://savannah.gnu.org/bugs/?64115>.  Thanks to Dave
    Kemper for the report.
    
    Tested with:
    
    $ echo | ./build/test-groff -fZD -z
    troff: fatal error: 'ZD' is not a valid font family
    $ echo | ./build/test-groff -fH -z
    $ nl ./EXPERIMENTS/validate-family.groff
         1  .tm .fam=\n[.fam]
         2  .fam H
         3  .tm .fam=\n[.fam]
         4  .fam
         5  .tm .fam=\n[.fam]
         6  .fam ZD
         7  .fam BOGUS
         8  .tm .fam=\n[.fam]
         9  .fam
        10  .tm .fam=\n[.fam]
    $ ./build/test-groff ./EXPERIMENTS/validate-family.groff
    .fam=T
    .fam=H
    .fam=T
    troff:./EXPERIMENTS/validate-family.groff:6: error: 'ZD' is not a valid
font family
    troff:./EXPERIMENTS/validate-family.groff:7: error: 'BOGUS' is not a valid
font family
    .fam=T
    .fam=H




    _______________________________________________________

Reply to this item at:

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

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


Reply via email to