bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #55155] .tr is overzealous in nroff output


From: Dave
Subject: [bug #55155] .tr is overzealous in nroff output
Date: Mon, 3 Dec 2018 12:50:24 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0

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

                 Summary: .tr is overzealous in nroff output
                 Project: GNU troff
            Submitted by: barx
            Submitted on: Mon 03 Dec 2018 11:50:22 AM CST
                Category: Device - others
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

$ printf 'A \[dg] B\n' | nroff | od -t x1z | head -1
0000000 41 20 7c 08 2d 20 42 0a 0a 0a 0a 0a 0a 0a 0a 0a  >A |.- B.........<

This shows that nroff outputs the dagger character as 7C 08 2D -- that is, a
vertical bar, a backspace, and a hyphen -- a perfectly reasonable facsimile of
a dagger in ASCII characters.

Now add a .tr request at the start of the file to change vertical bars in
input to the letter O:

$ printf '.tr |O\nA \[dg] B\n' | nroff | od -t x1z | head -1
0000000 41 20 4f 08 2d 20 42 0a 0a 0a 0a 0a 0a 0a 0a 0a  >A O.- B.........<

Now the dagger is represented by 4F 08 2D (capital O, backspace, hyphen -- not
at all a reasonable dagger construction).  The .tr is modifying not just
vertical bars in the input (which is its documented function: "the first
argument of `tr' should be an input character or entity") but a vertical bar
that was part of the way nroff built the dagger.  It's difficult to imagine a
situation in which this would be desirable.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]