diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-12 17:08:03 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-12 17:08:03 +0000 |
commit | 78bebdfe144e0c61d47fea953c79e7c9a79415fe (patch) | |
tree | 568377ee59d5d54dfa798dec4af9e6f3a1a1dd86 /mandoc.c | |
parent | 80adacfa690f8bc06d9b9d518080b5eaa1197e1f (diff) | |
download | mandoc-78bebdfe144e0c61d47fea953c79e7c9a79415fe.tar.gz |
Put the eos-checker into libmandoc.h.
Added bits in mdoc.7 and man.7 about EOS spacing.
Diffstat (limited to 'mandoc.c')
-rw-r--r-- | mandoc.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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); +} |