[bug #68357] [troff] doesn't enforce space between `dt` and `wh` request arguments

"G. Branden Robinson" <[email protected]>
Newsgroups gmane.comp.printing.groff.bugs
Message-ID <[email protected]>
Update of bug #68357 (group groff):

                Severity:           4 - Important => 3 - Normal

    _______________________________________________________

Follow-up Comment #4:

[comment #3 comment #3:]
> Ah, this turns out to be my fault.
> 
> I introduced the misbehavior some time in the _groff_ 1.24 development
> cycle.
> 
> This is therefore a regression.  Bumping up Severity.
> 
> Regression test already written, fortunately!

Nope, I was right the first time.  The (mis-)behavior documented in comment #0
goes back to _groff_ 1.22.3 at least.

What happened was, I wrote a regression test that relied on the new `pwh`
request, and no news looked like good news.

Problem confirmed on _groff_ 1.24.1, 1.24.0, 1.23.0, 1.22.4, and 1.22.3 with
the following script.


#!/bin/sh
#
# Copyright 2026 G. Branden Robinson
#
# This file is part of groff, the GNU roff typesetting system.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

groff="build/test-groff"
groff=$HOME/groff-1.22.3/bin/groff # change this as desired

fail=

wail () {
   echo "...FAILED"
   fail=yes
}

# Regression-test Savannah #68357.  We expect NO output.

input='.
.ec @
.de PT
OUCH
..
.de DT
WHOOPS
.br
..
.wh 9vPT
.tm .t=@n(.t
.di DD
.dt 3vDT
.tm .t=@n(.t
.br
.di
.'

error=$(printf '%s\n' "$input" | "$groff" 2>&1 >/dev/null | nl -ba \
    | tr '\t' ' ')
echo "$error"

echo "checking that invalid 'wh' request did not plant trap" >&2
echo "$error" | grep -Fq '1 .t=108000' && wail

echo "checking that invalid 'dt' request did not plant trap" >&2
echo "$error" | grep -Fq '2 .t=36000' && wail

test -z "$fail"

# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:


Test succeeds with a pending commit.

Setting Severity back down to "Normal".


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCahkS1QAKCRCqLAuaBUf3
TvJxAP9Szu8dyDptS9vnSb7JTql4+2kkQjId8lZZP2xcU4e9zQD7BO3Ifvn90DJ5
QP4JPf35aCW61Evzkjy7FeHVqrG55w0=
=ACDq
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.