diff options
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); +} |