diff options
author | 2015-04-23 16:17:04 +0000 | |
---|---|---|
committer | 2015-04-23 16:17:04 +0000 | |
commit | 423631c995882ca2c2da9e241987914cde8349c5 (patch) | |
tree | 350ff4d6cc2221cc6c767370e7d31fc5a42167cb /usr.bin/mandoc/mdoc_validate.c | |
parent | Get rid of two empty wrapper functions. No functional change. (diff) | |
download | wireguard-openbsd-423631c995882ca2c2da9e241987914cde8349c5.tar.xz wireguard-openbsd-423631c995882ca2c2da9e241987914cde8349c5.zip |
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 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 0063abd80cc..0c664f672ea 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.206 2015/04/20 09:48:19 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.207 2015/04/23 16:17:04 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -960,7 +960,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, @@ -1874,7 +1874,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. */ @@ -2123,7 +2123,7 @@ post_dd(POST_ARGS) } datestr = NULL; - mdoc_deroff(&datestr, n); + deroff(&datestr, n); if (mdoc->quick) mdoc->meta.date = datestr; else { @@ -2258,7 +2258,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; |