summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2013-12-22 13:24:00 +0000
committerschwarze <schwarze@openbsd.org>2013-12-22 13:24:00 +0000
commit6838389ded4d3d3be86f0fb881b3dd79cf3ea657 (patch)
treed221694fecef3c96bdf5700420349a90a6b4ca6e /usr.bin/mandoc/man_macro.c
parentSeems gcc4 whines about an empty file as well, so just unconditionally do (diff)
downloadwireguard-openbsd-6838389ded4d3d3be86f0fb881b3dd79cf3ea657.tar.xz
wireguard-openbsd-6838389ded4d3d3be86f0fb881b3dd79cf3ea657.zip
Implement end-of-sentence spacing at the end of man(7) macro lines.
Improves cvs(1) pcap-filter(3) readline(3) termcap(5) cvsbug(8) mkhybrid(8) nsd-zonec(8) in multiple places and c++filt(1) com_err(3) nsd_conf(5) term(5) nsdc(8) in one place each. Reduces overall groff-mandoc-differences in base by about 1.5%. Patch from Franco Fichtner <franco at lastsummer dot de> (DragonFly).
Diffstat (limited to 'usr.bin/mandoc/man_macro.c')
-rw-r--r--usr.bin/mandoc/man_macro.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c
index b810a6816a9..e1f5be37cef 100644
--- a/usr.bin/mandoc/man_macro.c
+++ b/usr.bin/mandoc/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.40 2013/11/11 00:35:51 schwarze Exp $ */
+/* $Id: man_macro.c,v 1.41 2013/12/22 13:24:00 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -428,6 +428,15 @@ in_line_eoln(MACRO_PROT_ARGS)
}
/*
+ * Append MAN_EOS in case the last snipped argument
+ * ends with a dot, e.g. `.IR syslog (3).'
+ */
+
+ if (n != man->last &&
+ mandoc_eos(man->last->string, strlen(man->last->string), 0))
+ man->last->flags |= MAN_EOS;
+
+ /*
* If no arguments are specified and this is MAN_SCOPED (i.e.,
* next-line scoped), then set our mode to indicate that we're
* waiting for terms to load into our context.