summaryrefslogtreecommitdiffstats
path: root/mandoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/mandoc.c b/mandoc.c
index dface045..6677295e 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -300,3 +300,26 @@ mandoc_a2time(int flags, const char *p)
return(0);
}
+
+int
+mandoc_eos(const char *p, size_t sz)
+{
+
+ assert(sz);
+
+ switch (p[(int)sz - 1]) {
+ case ('.'):
+ /* Escaped periods. */
+ if (sz > 1 && '\\' == p[(int)sz - 2])
+ return(0);
+ /* FALLTHROUGH */
+ case ('!'):
+ /* FALLTHROUGH */
+ case ('?'):
+ break;
+ default:
+ return(0);
+ }
+
+ return(1);
+}