From afaba3e78072edb0c5149a491c9709b57f31745a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 31 May 2022 18:09:57 +0000 Subject: Trivial patch to put the roff(7) \g (interpolate format of register) escape sequence into the correct parsing class, ESCAPE_EXPAND. Expansion of \g is supposed to work exactly like the expansion of the related escape sequence \n (interpolate register value), but since we ignore the .af (assign output format) request, we just interpolate an empty string to replace the \g sequence. Surprising as it may seem, this actually makes a formatting difference for deviate input like ".O\gNx" which used to raise bogus "escaped character not allowed in a name" and "skipping unknown macro" errors and printed nothing, whereas now it correctly prints "OpenBSD". --- roff.7 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'roff.7') diff --git a/roff.7 b/roff.7 index a9f424d5..90b6ddc7 100644 --- a/roff.7 +++ b/roff.7 @@ -2085,7 +2085,8 @@ defaults to .Ic \efP . .It Ic \eg[ Ns Ar name Ns Ic \&] Interpolate the format of a number register; ignored by -.Xr mandoc 1 . +.Xr mandoc 1 , +which interpolates an empty string instead. For short names, there are variants .Ic \eg Ns Ar c and -- cgit