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

                 Summary: [troff] `chop` request doesn't really work
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Sun 24 Aug 2025 04:13:04 AM GMT
                Category: Core
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 24 Aug 2025 04:13:04 AM GMT By: G. Branden Robinson <gbranden>
Input:


$ cat ATTIC/chop.groff
.box DIV
ABC
.br
.box
.nf \" so we can see any newlines
.DIV
.chop DIV
.DIV
.chop DIV
.DIV
.chop DIV
.DIV


What I expected:


$ groff -a ATTIC/chop.groff
ABC
ABCABA


What I got:


$ groff -a ATTIC/chop.groff
<beginning of page>
ABC
ABC.chop DIV
ABC.chop DIV
ABC


If the diversion doesn't have a newline in it, the formatter seems to chop the
newline from the input stream, which is quite wrong.


     .chop name
                Remove the last character from the macro, string, or
                diversion name.


This behavior reproduces all the way back to _groff_ 1.22.3.  I'd expect it
goes back farther still.







    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to