aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff_escape.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-06-02 14:51:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-06-02 14:51:41 +0000
commit3b52bb8d03ff61274832867c905a80a2761859aa (patch)
tree2762695c4a1dd993f52b5e3981ca97c10dd3a4bd /roff_escape.c
parent1ecd7d69278a7a53010b2bdde946bb18930ae850 (diff)
downloadmandoc-3b52bb8d03ff61274832867c905a80a2761859aa.tar.gz
mandoc-3b52bb8d03ff61274832867c905a80a2761859aa.tar.zst
mandoc-3b52bb8d03ff61274832867c905a80a2761859aa.zip
Since \. is not a character escape sequence, re-classify it from the
wrong parsing class ESCAPE_SPECIAL to the better-suited parsing class ESCAPE_UNDEF, exactly like it is already done for the similar \\, which isn't a character escape sequence either. No formatting change is intended just yet, but this will matter for upcoming improvements in the parser for roff(7) macro, string, and register names. See the node "5.23.2 Copy Mode" in "info groff" regarding what \\ and \. really mean.
Diffstat (limited to 'roff_escape.c')
-rw-r--r--roff_escape.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/roff_escape.c b/roff_escape.c
index 39011cde..9d02054d 100644
--- a/roff_escape.c
+++ b/roff_escape.c
@@ -127,6 +127,7 @@ roff_escape(const char *buf, const int ln, const int aesc,
case '\0':
iendarg = --iend;
/* FALLTHROUGH */
+ case '.':
case '\\':
default:
iarg--;
@@ -136,7 +137,6 @@ roff_escape(const char *buf, const int ln, const int aesc,
case ' ':
case '\'':
case '-':
- case '.':
case '0':
case ':':
case '_':
@@ -481,7 +481,7 @@ out:
err = MANDOCERR_ESC_UNSUPP;
break;
case ESCAPE_UNDEF:
- if (buf[inam] == '\\')
+ if (buf[inam] == '\\' || buf[inam] == '.')
return rval;
err = MANDOCERR_ESC_UNDEF;
break;