summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-23 16:17:44 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-23 16:17:44 +0000
commit16ee2910b2d5d0fad6b303e92efff26c0543db03 (patch)
tree83bd6cef6324bc9f9a440072d5a4d594703e057a /mdoc_validate.c
parent48b896d8e54fb00900d8be7283d92985cdcdb0f5 (diff)
downloadmandoc-16ee2910b2d5d0fad6b303e92efff26c0543db03.tar.gz
Unify mdoc_deroff() and man_deroff() into a common function deroff().
No functional change except that for mdoc(7), it now skips leading escape sequences just like it already did for man(7). Escape sequences rarely occur in mdoc(7) code and if they do, skipping them is an improvement in this context. Minus 30 lines of code.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 616e9b10..6c9fff89 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -969,7 +969,7 @@ post_nm(POST_ARGS)
if (NULL != mdoc->meta.name)
return;
- mdoc_deroff(&mdoc->meta.name, n);
+ deroff(&mdoc->meta.name, n);
if (NULL == mdoc->meta.name)
mandoc_msg(MANDOCERR_NM_NONAME, mdoc->parse,
@@ -1883,7 +1883,7 @@ post_sh_head(POST_ARGS)
secname = NULL;
sec = SEC_CUSTOM;
- mdoc_deroff(&secname, mdoc->last);
+ deroff(&secname, mdoc->last);
sec = NULL == secname ? SEC_CUSTOM : a2sec(secname);
/* The NAME should be first. */
@@ -2132,7 +2132,7 @@ post_dd(POST_ARGS)
}
datestr = NULL;
- mdoc_deroff(&datestr, n);
+ deroff(&datestr, n);
if (mdoc->quick)
mdoc->meta.date = datestr;
else {
@@ -2267,7 +2267,7 @@ post_os(POST_ARGS)
free(mdoc->meta.os);
mdoc->meta.os = NULL;
- mdoc_deroff(&mdoc->meta.os, n);
+ deroff(&mdoc->meta.os, n);
if (mdoc->meta.os)
goto out;