From ea452a23a02a06e590a1b863b12b3fa42b728535 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_escape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roff_escape.c') diff --git a/roff_escape.c b/roff_escape.c index 51e3d897..3c38ced7 100644 --- a/roff_escape.c +++ b/roff_escape.c @@ -158,6 +158,7 @@ roff_escape(const char *buf, const int ln, const int aesc, case '$': case '*': case 'V': + case 'g': case 'n': rval = ESCAPE_EXPAND; break; @@ -165,7 +166,6 @@ roff_escape(const char *buf, const int ln, const int aesc, case 'M': case 'O': case 'Y': - case 'g': case 'k': case 'm': rval = ESCAPE_IGNORE; -- cgit v1.2.3