diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-07 20:58:49 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-07 20:58:49 +0000 |
commit | be756d214c74f6eb13e12663900a345e88b76d9b (patch) | |
tree | 3fb1385518f7d89c58ef1c0b3660c5436975ffcb /mdoc.c | |
parent | 4c98151b506dab24c773ccfb5eb5d34f3ede915d (diff) | |
download | mandoc-be756d214c74f6eb13e12663900a345e88b76d9b.tar.gz |
Also catch "new sentence, new line" if there are three blanks
between the sentences. Thomas Klausner says he has seen some
of these, and i don't see any false positives.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -280,12 +280,18 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) continue; if (end - c < 3) break; - if (isalpha((unsigned char)c[-2]) && - isalpha((unsigned char)c[-1]) && - c[1] == ' ' && - isupper((unsigned char)(c[2] == ' ' ? c[3] : c[2])) && - (c[-2] != 'n' || c[-1] != 'c') && - (c[-2] != 'v' || c[-1] != 's')) + if (c[1] != ' ' || + isalpha((unsigned char)c[-2]) == 0 || + isalpha((unsigned char)c[-1]) == 0 || + (c[-2] == 'n' && c[-1] == 'c') || + (c[-2] == 'v' && c[-1] == 's')) + continue; + c += 2; + if (*c == ' ') + c++; + if (*c == ' ') + c++; + if (isupper((unsigned char)(*c))) mandoc_msg(MANDOCERR_EOS, mdoc->parse, line, (int)(c - buf), NULL); } |