Re: [PATCH] Don't use groff(1) specific string syntax

Herbert Xu <[email protected]> Sat, 9 May 2026 10:47:09 +0800
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
sebastien peterson boudreau <[email protected]> wrote:
> It's standard for troff(1)s to recognize \*( for 2 character
> strings, but \*[] is a GNU extension. I don't see any reason to
> use it.
> 
> groff_mdoc(7) also gives ``preferred'' alternatives to these uses
> in the section _Predefined strings_, but I don't know if these
> are portable; for some, it lists characters that are unique(?) to
> groff (in groff_char(7), characters with widespread portability
> are marked by a `+', and some of the preferred alternatives listed
> in groff_mdoc(7) are not marked as such), but \*(Lt and \*(Gt have
> preferred alternatives of simply the ASCII < and > characters.
> ---
> src/dash.1 | 58 +++++++++++++++++++++++++++---------------------------
> 1 file changed, 29 insertions(+), 29 deletions(-)

Thanks for working on this!

I checked the NetBSD code and they replaced these with literals
instead.  Any reason why we can't do the same thing?

> diff --git a/src/dash.1 b/src/dash.1
> index dbc34c9..0fcb183 100644
> --- a/src/dash.1
> +++ b/src/dash.1
> @@ -197,7 +197,7 @@ operand and the positional parameters ($1, $2, etc.)
> set from the remaining argument operands.
> .It Fl C Em noclobber
> Don't overwrite existing files with
> -.Dq \*[Gt] .
> +.Dq \*(Gt .

NetBSD simply replaced "\*[Gt]" with ">".

https://github.com/NetBSD/src/commit/30b9dfc8813e15031a13fc2fc85094b81c71e2b7

Cheers,
-- 
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt