summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-14 19:52:44 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-14 19:52:44 +0000
commit3cce8de3c5ac3b5f6a69a551cd7f542ea28ce781 (patch)
treeccf8b10982fe7aeb28b4829db92824206e362dc1 /usr.bin/mandoc/man.c
parent91f46c931780d7b547ff88e7f5860d322a57cfca (diff)
Integrate kristaps@' end-of-sentence (EOS) framework
which is simpler and more powerful than mine, and remove mine. * man(7) now has EOS handling, too * put EOS detection into its own function in libmandoc * use node and termp flags to communicate the EOS condition * no more EOS pseudo-macro * no more non-printable EOS marker character on the formatter level This slightly breaks EOS detection after trailing punctuation in mdoc(7) macros, but that will be restored soon.
Diffstat (limited to 'usr.bin/mandoc/man.c')
-rw-r--r--usr.bin/mandoc/man.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index 3d0c5bf50a4..8ebac56ed9d 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.27 2010/05/14 01:54:37 schwarze Exp $ */
+/* $Id: man.c,v 1.28 2010/05/14 19:52:43 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -433,6 +433,17 @@ man_ptext(struct man *m, int line, char *buf)
if ( ! man_word_alloc(m, line, 0, buf))
return(0);
+ /*
+ * End-of-sentence check. If the last character is an unescaped
+ * EOS character, then flag the node as being the end of a
+ * sentence. The front-end will know how to interpret this.
+ */
+
+ assert(i);
+
+ if (mandoc_eos(buf, (size_t)i))
+ m->last->flags |= MAN_EOS;
+
descope:
/*
* Co-ordinate what happens with having a next-line scope open: