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

                 Summary: [troff] `ev` request should not perform operation if
argument invalid
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Mon 23 Nov 2026 04:05:47 PM UTC
                Category: Formatter
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 23 Nov 2026 04:05:47 PM UTC By: G. Branden Robinson <gbranden>
Exhibit:


$ printf '.ev newenv\n.tmc before:\n.pnr .ev\n.ev bo\002gus\n.tmc after:\n.pnr
.ev\n' | ~/groff-1.25.0/bin/groff
before:.ev      newenv
troff:<standard input>:4: error: ignoring identifier containing invalid
character code 2
after:.ev       0
$ printf '.ev newenv\n.tmc before:\n.pnr .ev\n.ev bo\002gus\n.tmc after:\n.pnr
.ev\n' | ~/groff-1.24.0/bin/groff
before:.ev      newenv
troff:<standard input>:4: error: character code 2 is not allowed in an
identifier
after:.ev       0


Behavior in earlier versions of GNU _troff_ was even stranger: instead of
popping the environment, a new one with a name truncated at the first invalid
character in the argument would be pushed.


$ printf '.ev newenv\n.tmc before:\n.tm .ev=\\n[.ev]\n.ev bo\\&gus\n.tmc
after:\n.tm .ev=\\n[.ev]\n' | ~/groff-1.23.0/bin/groff
before:.ev=newenv
troff:<standard input>:4: error: an escaped '&' is not allowed in an
identifier
after:.ev=bo


...unless that truncated the argument to emptiness, then it would pop the
environment again.


$ printf '.ev newenv\n.tmc before:\n.tm .ev=\\n[.ev]\n.ev \\&gus\n.tmc
after:\n.tm .ev=\\n[.ev]\n' | ~/groff-1.23.0/bin/groff
before:.ev=newenv
troff:<standard input>:4: error: expected identifier, got an escaped '&';
treated as missing
after:.ev=0









    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to